bugfix: fix error, where the winrm default path is not set properly by default

This commit is contained in:
Christoph Hartmann 2015-10-05 15:35:02 +02:00
parent d82eeb045e
commit f38ce7d5f4
2 changed files with 17 additions and 0 deletions

View file

@ -33,6 +33,9 @@ module Vulcano
conf['path'] ||= uri.path
end
# ensure path is nil, if its empty; e.g. required to reset defaults for winrm
conf['path'] = nil if !conf['path'].nil? && conf['path'].to_s.empty?
# return the updated config
conf
end

View file

@ -43,6 +43,20 @@ describe 'Vulcano::Backend' do
res.must_equal org
end
it 'resolves a winrm target' do
org = {
'target' => 'winrm://Administrator@192.168.10.140',
'backend' => 'winrm',
'host' => '192.168.10.140',
'user' => 'Administrator',
'password' => nil,
'port' => nil,
'path' => nil
}
res = Vulcano::Backend.target_config(org)
res.must_equal org
end
it 'keeps the configuration when incorrect target is supplied' do
org = {
'target' => 'wrong',