Skip to content

Allow user to specify a configuration file in VMPOOLER_CONFIG_FILE variable#241

Merged
mattkirby merged 1 commit into
puppetlabs:masterfrom
amcdson:config_file
Jan 23, 2018
Merged

Allow user to specify a configuration file in VMPOOLER_CONFIG_FILE variable#241
mattkirby merged 1 commit into
puppetlabs:masterfrom
amcdson:config_file

Conversation

@amcdson

@amcdson amcdson commented Oct 9, 2017

Copy link
Copy Markdown

Previously, there were two ways to configure Vmpooler, either by
changing the contents of vmpooler.yaml or by assigning the raw YAML
to the VMPOOLER_CONFIG environment variable. This commit adds a new
environment variable called VMPOOLER_CONFIG_FILE that can be assigned
the name of a config file to use. Also fixes #240 by whitelisting the
Symbol class when calling YAML.safe_load in Vmpooler.config.

@logicminds

Copy link
Copy Markdown
Contributor

@adamdav There is a failure in the test because the vmpooler.yaml cannot be found. You might want to mock that file in that test.

 1) Vmpooler .config when no config is given defaults to vmpooler.yaml
     Failure/Error: default_config = YAML.load_file(default_config_file)
     
     Errno::ENOENT:
       No such file or directory @ rb_sysopen - /home/travis/build/puppetlabs/vmpooler/spec/fixtures/vmpooler.yaml
     # ./spec/unit/vmpooler_spec.rb:17:in `block (4 levels) in <top (required)>'

@glennsarti glennsarti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, AND TESTS!!!! awesome. If you rebase onto master, that'll fix the travis errors.

variable

Previously, there were two ways to configure Vmpooler, either by
changing the contents of vmpooler.yaml or by assigning the raw YAML
to the VMPOOLER_CONFIG environment variable. This commit adds a new
environment variable called VMPOOLER_CONFIG_FILE that can be assigned
the name of a config file to use. Also fixes puppetlabs#240 by whitelisting the
Symbol class when calling YAML.safe_load in Vmpooler.config.
@amcdson

amcdson commented Jan 23, 2018

Copy link
Copy Markdown
Author

@glennsarti branch is rebased

@mattkirby mattkirby merged commit 878c93f into puppetlabs:master Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YAML.safe_load does not work with symbols in config file

4 participants