mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
bugfix: fix error, where the winrm default path is not set properly by default
This commit is contained in:
parent
d82eeb045e
commit
f38ce7d5f4
2 changed files with 17 additions and 0 deletions
|
@ -33,6 +33,9 @@ module Vulcano
|
||||||
conf['path'] ||= uri.path
|
conf['path'] ||= uri.path
|
||||||
end
|
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
|
# return the updated config
|
||||||
conf
|
conf
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,6 +43,20 @@ describe 'Vulcano::Backend' do
|
||||||
res.must_equal org
|
res.must_equal org
|
||||||
end
|
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
|
it 'keeps the configuration when incorrect target is supplied' do
|
||||||
org = {
|
org = {
|
||||||
'target' => 'wrong',
|
'target' => 'wrong',
|
||||||
|
|
Loading…
Reference in a new issue