mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
add fix
Signed-off-by: mr.exz <root@exzec.ru>
This commit is contained in:
parent
4647664d56
commit
38c9648eb4
1 changed files with 4 additions and 6 deletions
|
@ -9,7 +9,7 @@ module Secrets
|
|||
attr_reader :attributes
|
||||
|
||||
def self.resolve(target)
|
||||
unless target.is_a?(String) && File.file?(target)
|
||||
unless target.is_a?(String) && File.file?(target) && ['.yml', '.yaml'].include?(File.extname(target).downcase)
|
||||
return nil
|
||||
end
|
||||
new(target)
|
||||
|
@ -17,11 +17,9 @@ module Secrets
|
|||
|
||||
# array of yaml file paths
|
||||
def initialize(target)
|
||||
begin
|
||||
@attributes = ::YAML.load_file(target)
|
||||
rescue => e
|
||||
raise "Error reading Inspec attributes: #{e}"
|
||||
end
|
||||
@attributes = ::YAML.load_file(target)
|
||||
rescue => e
|
||||
raise "Error reading Inspec attributes: #{e}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue