mirror of
https://github.com/inspec/inspec
synced 2024-11-26 22:50:36 +00:00
bugfix: support multiple values in ssh config like 'HostKey', improve readability by extracting the first value from array, if we have only one value
This commit is contained in:
parent
ae514959d2
commit
cdf15b9dd1
1 changed files with 5 additions and 2 deletions
|
@ -31,7 +31,10 @@ class SshConf < Vulcano.resource(1)
|
|||
end
|
||||
|
||||
def method_missing(name)
|
||||
@params[name.to_s]
|
||||
param = @params[name.to_s]
|
||||
# extract first value if we have only one value in array
|
||||
param = param[0] if !param.nil? && param.length == 1
|
||||
param
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -50,7 +53,7 @@ class SshConf < Vulcano.resource(1)
|
|||
# parse the file
|
||||
@params = SimpleConfig.new(@conf.content,
|
||||
assignment_re: /^\s*(\S+?)\s+(.*?)\s*$/,
|
||||
multiple_values: false
|
||||
multiple_values: true
|
||||
).params
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue