lib/inspec/profile.rb in inspec-4.12.0 vs lib/inspec/profile.rb in inspec-4.16.0

- old
+ new

@@ -114,22 +114,32 @@ # The AttributeRegistry is in charge of keeping track of inputs; # it is the single source of truth. Now that we have a profile object, # we can create any inputs that were provided by various mechanisms. options[:runner_conf] ||= Inspec::Config.cached + # Catch legacy CLI input option usage if options[:runner_conf].key?(:attrs) Inspec.deprecate(:rename_attributes_to_inputs, "Use --input-file on the command line instead of --attrs.") options[:runner_conf][:input_file] = options[:runner_conf].delete(:attrs) + elsif options[:runner_conf].key?(:input_files) + # The kitchen-inspec docs say to use plural. Our CLI and internal expectations are singular. + options[:runner_conf][:input_file] = options[:runner_conf].delete(:input_files) end + # Catch legacy kitchen-inspec input usage + if options[:runner_conf].key?(:attributes) + Inspec.deprecate(:rename_attributes_to_inputs, "Use :inputs in your kitchen.yml verifier config instead of :attributes.") + options[:runner_conf][:inputs] = options[:runner_conf].delete(:attributes) + end + Inspec::InputRegistry.bind_profile_inputs( # Every input only exists in the context of a profile metadata.params[:name], # TODO: test this with profile aliasing # Remaining args are possible sources of inputs cli_input_files: options[:runner_conf][:input_file], # From CLI --input-file profile_metadata: metadata, - # TODO: deprecation checks here - runner_api: options[:runner_conf][:attributes] # This is the route the audit_cookbook and kitchen-inspec take + runner_api: options[:runner_conf][:inputs], # This is the route the audit_cookbook and kitchen-inspec take + cli_input_arg: options[:runner_conf][:input] # The --input name=value CLI option ) @runner_context = options[:profile_context] || Inspec::ProfileContext.for_profile(self, @backend)