2
0

chore(rubocop): allow use of YAML.load for _mapdata.rb [skip ci]

* Automated using https://github.com/myii/ssf-formula/pull/296
This commit is contained in:
Daniel Dehennin 2021-02-23 21:51:25 +00:00 committed by Imran Iqbal
parent 4dc422598b
commit 6dbba14a29
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819
5 changed files with 7 additions and 4 deletions

View File

@ -12,5 +12,8 @@ Metrics/BlockLength:
- describe - describe
# Increase from default of `25` # Increase from default of `25`
Max: 30 Max: 30
Security/YAMLLoad:
Exclude:
- test/integration/**/_mapdata.rb
# Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config` # Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`

View File

@ -23,7 +23,7 @@ control 'salt._mapdata' do
mapdata_file_path = "_mapdata/#{platform_finger}.yaml" mapdata_file_path = "_mapdata/#{platform_finger}.yaml"
# Load the mapdata from profile, into a YAML structure # Load the mapdata from profile, into a YAML structure
# https://docs.chef.io/inspec/profiles/#profile-files # https://docs.chef.io/inspec/profiles/#profile-files
mapdata_file_yaml = YAML.safe_load(inspec.profile.file(mapdata_file_path)) mapdata_file_yaml = YAML.load(inspec.profile.file(mapdata_file_path))
# Dump the YAML back into a string for comparison # Dump the YAML back into a string for comparison
mapdata_file_dump = YAML.dump(mapdata_file_yaml) mapdata_file_dump = YAML.dump(mapdata_file_yaml)

View File

@ -23,7 +23,7 @@ control 'salt._mapdata' do
mapdata_file_path = "_mapdata/#{platform_finger}.yaml" mapdata_file_path = "_mapdata/#{platform_finger}.yaml"
# Load the mapdata from profile, into a YAML structure # Load the mapdata from profile, into a YAML structure
# https://docs.chef.io/inspec/profiles/#profile-files # https://docs.chef.io/inspec/profiles/#profile-files
mapdata_file_yaml = YAML.safe_load(inspec.profile.file(mapdata_file_path)) mapdata_file_yaml = YAML.load(inspec.profile.file(mapdata_file_path))
# Dump the YAML back into a string for comparison # Dump the YAML back into a string for comparison
mapdata_file_dump = YAML.dump(mapdata_file_yaml) mapdata_file_dump = YAML.dump(mapdata_file_yaml)

View File

@ -23,7 +23,7 @@ control 'salt._mapdata' do
mapdata_file_path = "_mapdata/#{platform_finger}.yaml" mapdata_file_path = "_mapdata/#{platform_finger}.yaml"
# Load the mapdata from profile, into a YAML structure # Load the mapdata from profile, into a YAML structure
# https://docs.chef.io/inspec/profiles/#profile-files # https://docs.chef.io/inspec/profiles/#profile-files
mapdata_file_yaml = YAML.safe_load(inspec.profile.file(mapdata_file_path)) mapdata_file_yaml = YAML.load(inspec.profile.file(mapdata_file_path))
# Dump the YAML back into a string for comparison # Dump the YAML back into a string for comparison
mapdata_file_dump = YAML.dump(mapdata_file_yaml) mapdata_file_dump = YAML.dump(mapdata_file_yaml)

View File

@ -23,7 +23,7 @@ control 'salt._mapdata' do
mapdata_file_path = "_mapdata/#{platform_finger}.yaml" mapdata_file_path = "_mapdata/#{platform_finger}.yaml"
# Load the mapdata from profile, into a YAML structure # Load the mapdata from profile, into a YAML structure
# https://docs.chef.io/inspec/profiles/#profile-files # https://docs.chef.io/inspec/profiles/#profile-files
mapdata_file_yaml = YAML.safe_load(inspec.profile.file(mapdata_file_path)) mapdata_file_yaml = YAML.load(inspec.profile.file(mapdata_file_path))
# Dump the YAML back into a string for comparison # Dump the YAML back into a string for comparison
mapdata_file_dump = YAML.dump(mapdata_file_yaml) mapdata_file_dump = YAML.dump(mapdata_file_yaml)