Method: Inspec::Runner#load_attributes
- Defined in:
- lib/inspec/runner.rb
#load_attributes(options) ⇒ Object
determine all attributes before the execution, fetch data from secrets backend
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/inspec/runner.rb', line 147 def load_attributes() [:attributes] ||= {} secrets_targets = [:attrs] return [:attributes] if secrets_targets.nil? secrets_targets.each do |target| validate_attributes_file_readability!(target) secrets = Inspec::SecretsBackend.resolve(target) if secrets.nil? raise Inspec::Exceptions::SecretsBackendNotFound, "Cannot find parser for attributes file '#{target}'. " \ 'Check to make sure file has the appropriate extension.' end next if secrets.attributes.nil? [:attributes].merge!(secrets.attributes) end [:attributes] end |