move user default settings to backend

This commit is contained in:
Christoph Hartmann 2015-09-10 12:28:39 +01:00 committed by Dominik Richter
parent 51fff9104b
commit d0d9a66e4a
2 changed files with 7 additions and 3 deletions

View file

@ -21,7 +21,7 @@ module Vulcano
conf['backend'] = conf['backend'] || uri.scheme
conf['host'] = conf['host'] || uri.host
conf['port'] = conf['port'] || uri.port
conf['user'] = conf['user'] || uri.user || 'root'
conf['user'] = conf['user'] || uri.user
conf['password'] = conf['password'] || uri.password
# return the updated config

View file

@ -115,7 +115,7 @@ module Vulcano::Backends
user_known_hosts_file: '/dev/null',
global_known_hosts_file: '/dev/null',
number_of_password_prompts: 0,
user: @conf['user'],
user: @conf['user'] || 'root',
password: @conf['password'],
keys: [@conf['key_file']].compact,
}
@ -149,7 +149,11 @@ module Vulcano::Backends
# validation
user = @conf['user'].to_s
pass = @conf['password'].to_s
fail 'You must configure a WinRM user for login.' if user.empty?
if user.empty?
warn "We use default 'Administrator' as WinRM user for login."
user = 'Administrator'
end
fail 'You must configure a WinRM password.' if pass.empty?
# create the connection