mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
simplify method returns
This commit is contained in:
parent
129395141b
commit
b70ba447b2
1 changed files with 4 additions and 2 deletions
|
@ -105,12 +105,14 @@ class RegistryKey < Inspec.resource(1)
|
|||
begin
|
||||
@registy_cache = JSON.parse(cmd.stdout)
|
||||
# convert keys to lower case
|
||||
return @registy_cache = Hash[@registy_cache.map do |key, value|
|
||||
@registy_cache = Hash[@registy_cache.map do |key, value|
|
||||
[key.downcase, value]
|
||||
end]
|
||||
rescue JSON::ParserError => _e
|
||||
return @registy_cache = nil
|
||||
@registy_cache = nil
|
||||
end
|
||||
|
||||
@registy_cache
|
||||
end
|
||||
|
||||
# Registry key value types
|
||||
|
|
Loading…
Add table
Reference in a new issue