mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
commit
2bf7c4a715
3 changed files with 47 additions and 6 deletions
|
|
@ -21,11 +21,18 @@ module Vmpooler
|
|||
end
|
||||
|
||||
def self.config(filepath='vmpooler.yaml')
|
||||
# Load the configuration file
|
||||
config_file = File.expand_path(filepath)
|
||||
parsed_config = YAML.load_file(config_file)
|
||||
parsed_config = {}
|
||||
|
||||
# Set some defaults
|
||||
if ENV['VMPOOLER_CONFIG']
|
||||
# Load configuration from ENV
|
||||
parsed_config = YAML.load(ENV['VMPOOLER_CONFIG'])
|
||||
else
|
||||
# Load the configuration file from disk
|
||||
config_file = File.expand_path(filepath)
|
||||
parsed_config = YAML.load_file(config_file)
|
||||
end
|
||||
|
||||
# Set some configuration defaults
|
||||
parsed_config[:redis] ||= {}
|
||||
parsed_config[:redis]['server'] ||= 'localhost'
|
||||
parsed_config[:redis]['data_ttl'] ||= 168
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue