Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 23, 2018

Conversation

adamdav
Copy link

@adamdav adamdav commented Oct 9, 2017

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
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)>'

Copy link
Contributor

@glennsarti glennsarti left a comment

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.
@adamdav
Copy link
Author

adamdav commented Jan 23, 2018

@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