mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
(POOLER-71) dummy auth only works in debug mode
If a user attempts to start vmpooler using dummy authentication without setting the environment variable VMPOOLER_DEBUG, the vmpooler will now refuse to start.
This commit is contained in:
parent
2c74f4fa3a
commit
eb67ccad5a
1 changed files with 13 additions and 0 deletions
|
|
@ -32,6 +32,19 @@ module Vmpooler
|
|||
parsed_config = YAML.load_file(config_file)
|
||||
end
|
||||
|
||||
# Bail out if someone attempts to start vmpooler with dummy authentication
|
||||
# without enbaling debug mode.
|
||||
if parsed_config[:auth]['provider'] == 'dummy'
|
||||
unless ENV['VMPOOLER_DEBUG']
|
||||
warning = [
|
||||
"Dummy authentication should not be used outside of debug mode",
|
||||
"please set environment variable VMPOOLER_DEBUG to 'true' if you want to use dummy authentication",
|
||||
]
|
||||
|
||||
raise warning.join(";\s")
|
||||
end
|
||||
end
|
||||
|
||||
# Set some configuration defaults
|
||||
parsed_config[:redis] ||= {}
|
||||
parsed_config[:redis]['server'] ||= 'localhost'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue