diff options
Diffstat (limited to 'lib')
109 files changed, 467 insertions, 467 deletions
diff --git a/lib/chef/api_client.rb b/lib/chef/api_client.rb index b7b9f7dc43..940ec19d90 100644 --- a/lib/chef/api_client.rb +++ b/lib/chef/api_client.rb @@ -53,7 +53,7 @@ class Chef set_or_return( :name, arg, - :regex => /^[\-[:alnum:]_\.]+$/ + :regex => /^[\-[:alnum:]_\.]+$/, ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :admin, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -77,7 +77,7 @@ class Chef set_or_return( :public_key, arg, - :kind_of => String + :kind_of => String, ) end @@ -90,7 +90,7 @@ class Chef set_or_return( :validator, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -102,7 +102,7 @@ class Chef set_or_return( :private_key, arg, - :kind_of => [String, FalseClass] + :kind_of => [String, FalseClass], ) end @@ -117,7 +117,7 @@ class Chef "validator" => @validator, "admin" => @admin, 'json_class' => self.class.name, - "chef_type" => "client" + "chef_type" => "client", } result["private_key"] = @private_key if @private_key result diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb index 99667acc0a..f7278a8a48 100644 --- a/lib/chef/api_client/registration.rb +++ b/lib/chef/api_client/registration.rb @@ -151,8 +151,8 @@ class Chef { :api_version => "0", :client_name => Chef::Config[:validation_client_name], - :signing_key_filename => Chef::Config[:validation_key] - } + :signing_key_filename => Chef::Config[:validation_key], + }, ) end diff --git a/lib/chef/api_client_v1.rb b/lib/chef/api_client_v1.rb index 80f0d2517c..7329343f43 100644 --- a/lib/chef/api_client_v1.rb +++ b/lib/chef/api_client_v1.rb @@ -76,7 +76,7 @@ class Chef set_or_return( :name, arg, - :regex => /^[\-[:alnum:]_\.]+$/ + :regex => /^[\-[:alnum:]_\.]+$/, ) end @@ -88,7 +88,7 @@ class Chef set_or_return( :admin, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -100,7 +100,7 @@ class Chef set_or_return( :public_key, arg, - :kind_of => String + :kind_of => String, ) end @@ -113,7 +113,7 @@ class Chef set_or_return( :validator, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -126,7 +126,7 @@ class Chef set_or_return( :private_key, arg, - :kind_of => [String, TrueClass, FalseClass] + :kind_of => [String, TrueClass, FalseClass], ) end @@ -138,7 +138,7 @@ class Chef set_or_return( :create_key, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -151,7 +151,7 @@ class Chef "name" => @name, "validator" => @validator, "admin" => @admin, - "chef_type" => "client" + "chef_type" => "client", } result["private_key"] = @private_key unless @private_key.nil? result["public_key"] = @public_key unless @public_key.nil? @@ -282,7 +282,7 @@ class Chef :validator => validator, # this field is ignored in API V1, but left for backwards-compat, # can remove after OSC 11 support is finished? - :admin => admin + :admin => admin, } begin # try API V1 diff --git a/lib/chef/application.rb b/lib/chef/application.rb index 3ab68260d7..680f99df56 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -207,7 +207,7 @@ class Chef @chef_client_json, override_runlist: override_runlist, specific_recipes: specific_recipes, - runlist: config[:runlist] + runlist: config[:runlist], ) @chef_client_json = nil diff --git a/lib/chef/application/windows_service.rb b/lib/chef/application/windows_service.rb index 9becf4b33f..fd7cc7dd18 100644 --- a/lib/chef/application/windows_service.rb +++ b/lib/chef/application/windows_service.rb @@ -198,7 +198,7 @@ class Chef result = shell_out( "chef-client #{config_params}", :timeout => Chef::Config[:windows_service][:watchdog_timeout], - :logger => Chef::Log + :logger => Chef::Log, ) Chef::Log.debug "#{result.stdout}" Chef::Log.debug "#{result.stderr}" diff --git a/lib/chef/application/windows_service_manager.rb b/lib/chef/application/windows_service_manager.rb index d969896025..4bb624989e 100644 --- a/lib/chef/application/windows_service_manager.rb +++ b/lib/chef/application/windows_service_manager.rb @@ -124,11 +124,11 @@ class Chef :binary_path_name => cmd, :service_start_name => @service_start_name, :password => @password, - :dependencies => @dependencies + :dependencies => @dependencies, ) ::Win32::Service.configure( :service_name => @service_name, - :delayed_start => @delayed_start + :delayed_start => @delayed_start, ) unless @delayed_start.nil? puts "Service '#{@service_name}' has successfully been installed." end diff --git a/lib/chef/audit/audit_event_proxy.rb b/lib/chef/audit/audit_event_proxy.rb index b9ca39e5dc..ddcb170955 100644 --- a/lib/chef/audit/audit_event_proxy.rb +++ b/lib/chef/audit/audit_event_proxy.rb @@ -84,7 +84,7 @@ class Chef :resource_type => resource_type, :resource_name => resource_name, :context => describe_groups, - :line_number => example.metadata[:line_number] + :line_number => example.metadata[:line_number], } end diff --git a/lib/chef/audit/control_group_data.rb b/lib/chef/audit/control_group_data.rb index 204d7f8070..62623b0b64 100644 --- a/lib/chef/audit/control_group_data.rb +++ b/lib/chef/audit/control_group_data.rb @@ -41,7 +41,7 @@ class Chef :run_id => run_id, :start_time => start_time, :end_time => end_time, - :control_groups => control_groups.collect { |c| c.to_hash } + :control_groups => control_groups.collect { |c| c.to_hash }, } end end @@ -86,7 +86,7 @@ class Chef :status => status, :number_succeeded => number_succeeded, :number_failed => number_failed, - :controls => controls.collect { |c| c.to_hash } + :controls => controls.collect { |c| c.to_hash }, } # If there is a duplicate key, metadata will overwrite it add_display_only_data(h).merge(metadata) @@ -129,7 +129,7 @@ class Chef :status => status, :details => details, :resource_type => resource_type, - :resource_name => resource_name + :resource_name => resource_name, } h[:context] = context || [] h diff --git a/lib/chef/chef_fs/config.rb b/lib/chef/chef_fs/config.rb index 260882ae70..29c9d3b879 100644 --- a/lib/chef/chef_fs/config.rb +++ b/lib/chef/chef_fs/config.rb @@ -41,7 +41,7 @@ class Chef "roles" => "role", "users" => "user", "policies" => "policy", - "policy_groups" => "policy_group" + "policy_groups" => "policy_group", } INFLECTIONS.each { |k,v| k.freeze; v.freeze } INFLECTIONS.freeze diff --git a/lib/chef/chef_fs/data_handler/acl_data_handler.rb b/lib/chef/chef_fs/data_handler/acl_data_handler.rb index 8def8a543d..6096b6e43c 100644 --- a/lib/chef/chef_fs/data_handler/acl_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/acl_data_handler.rb @@ -11,8 +11,8 @@ class Chef 'read' => {}, 'update' => {}, 'delete' => {}, - 'grant' => {} - }) + 'grant' => {}, + },) result.keys.each do |key| result[key] = normalize_hash(result[key], { 'actors' => [], 'groups' => [] }) result[key]['actors'] = result[key]['actors'].sort diff --git a/lib/chef/chef_fs/data_handler/client_data_handler.rb b/lib/chef/chef_fs/data_handler/client_data_handler.rb index 5bcbd4e373..421a463c2f 100644 --- a/lib/chef/chef_fs/data_handler/client_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/client_data_handler.rb @@ -11,7 +11,7 @@ class Chef 'clientname' => remove_dot_json(entry.name), 'admin' => false, 'validator' => false, - 'chef_type' => 'client' + 'chef_type' => 'client', } # Handle the fact that admin/validator have changed type from string -> boolean client['admin'] = (client['admin'] == 'true') if client['admin'].is_a?(String) diff --git a/lib/chef/chef_fs/data_handler/container_data_handler.rb b/lib/chef/chef_fs/data_handler/container_data_handler.rb index 980453cbab..f03005f947 100644 --- a/lib/chef/chef_fs/data_handler/container_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/container_data_handler.rb @@ -7,8 +7,8 @@ class Chef def normalize(container, entry) normalize_hash(container, { 'containername' => remove_dot_json(entry.name), - 'containerpath' => remove_dot_json(entry.name) - }) + 'containerpath' => remove_dot_json(entry.name), + },) end def preserve_key?(key) diff --git a/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb index 56b7e0b765..0f2cad7983 100644 --- a/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb @@ -15,12 +15,12 @@ class Chef 'json_class' => 'Chef::CookbookVersion', 'chef_type' => 'cookbook_version', 'frozen?' => false, - 'metadata' => {} - }) + 'metadata' => {}, + },) result['metadata'] = normalize_hash(result['metadata'], { 'version' => version, - 'name' => name - }) + 'name' => name, + },) end def preserve_key?(key) diff --git a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb index 1306922081..e2d0f43de2 100644 --- a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb @@ -14,7 +14,7 @@ class Chef # use those in knife-essentials. normalize_hash(data_bag_item, { 'id' => remove_dot_json(entry.name) - }) + },) end def normalize_for_post(data_bag_item, entry) @@ -26,7 +26,7 @@ class Chef "json_class" => "Chef::DataBagItem", "chef_type" => "data_bag_item", "data_bag" => entry.parent.name, - "raw_data" => normalize(data_bag_item, entry) + "raw_data" => normalize(data_bag_item, entry), } end diff --git a/lib/chef/chef_fs/data_handler/environment_data_handler.rb b/lib/chef/chef_fs/data_handler/environment_data_handler.rb index 5105f2ac49..5152a01e39 100644 --- a/lib/chef/chef_fs/data_handler/environment_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/environment_data_handler.rb @@ -13,8 +13,8 @@ class Chef 'default_attributes' => {}, 'override_attributes' => {}, 'json_class' => 'Chef::Environment', - 'chef_type' => 'environment' - }) + 'chef_type' => 'environment', + },) end def preserve_key?(key) diff --git a/lib/chef/chef_fs/data_handler/group_data_handler.rb b/lib/chef/chef_fs/data_handler/group_data_handler.rb index 1a36c66eb8..40cb57b78a 100644 --- a/lib/chef/chef_fs/data_handler/group_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/group_data_handler.rb @@ -28,7 +28,7 @@ class Chef result['actors'] = { 'users' => result['users'], 'clients' => result['clients'], - 'groups' => result['groups'] + 'groups' => result['groups'], } result.delete('users') result.delete('clients') diff --git a/lib/chef/chef_fs/data_handler/node_data_handler.rb b/lib/chef/chef_fs/data_handler/node_data_handler.rb index 04faa527f0..c4910b55b9 100644 --- a/lib/chef/chef_fs/data_handler/node_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/node_data_handler.rb @@ -15,8 +15,8 @@ class Chef 'normal' => {}, 'default' => {}, 'automatic' => {}, - 'run_list' => [] - }) + 'run_list' => [], + },) result['run_list'] = normalize_run_list(result['run_list']) result end diff --git a/lib/chef/chef_fs/data_handler/organization_data_handler.rb b/lib/chef/chef_fs/data_handler/organization_data_handler.rb index da911c08f0..7b1bcc4c6c 100644 --- a/lib/chef/chef_fs/data_handler/organization_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/organization_data_handler.rb @@ -11,7 +11,7 @@ class Chef 'org_type' => 'Business', 'clientname' => "#{entry.org}-validator", 'billing_plan' => 'platform-free', - }) + },) result end diff --git a/lib/chef/chef_fs/data_handler/policy_data_handler.rb b/lib/chef/chef_fs/data_handler/policy_data_handler.rb index 9f4d7479fc..32a7a791f7 100644 --- a/lib/chef/chef_fs/data_handler/policy_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/policy_data_handler.rb @@ -21,7 +21,7 @@ class Chef 'name' => name, 'revision_id' => revision_id, 'run_list' => [], - 'cookbook_locks' => {} + 'cookbook_locks' => {}, } normalize_hash(policy, defaults) end diff --git a/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb b/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb index 6ada606e49..10de6abb42 100644 --- a/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb @@ -8,7 +8,7 @@ class Chef def normalize(policy_group, entry) defaults = { "name" => remove_dot_json(entry.name), - "policies" => {} + "policies" => {}, } result = normalize_hash(policy_group, defaults) result.delete("uri") # not useful data diff --git a/lib/chef/chef_fs/data_handler/role_data_handler.rb b/lib/chef/chef_fs/data_handler/role_data_handler.rb index 21c3013e9f..d7530f0b9b 100644 --- a/lib/chef/chef_fs/data_handler/role_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/role_data_handler.rb @@ -14,8 +14,8 @@ class Chef 'default_attributes' => {}, 'override_attributes' => {}, 'run_list' => [], - 'env_run_lists' => {} - }) + 'env_run_lists' => {}, + },) result['run_list'] = normalize_run_list(result['run_list']) result['env_run_lists'].each_pair do |env, run_list| result['env_run_lists'][env] = normalize_run_list(run_list) diff --git a/lib/chef/chef_fs/data_handler/user_data_handler.rb b/lib/chef/chef_fs/data_handler/user_data_handler.rb index f6859faccd..01c673b460 100644 --- a/lib/chef/chef_fs/data_handler/user_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/user_data_handler.rb @@ -14,8 +14,8 @@ class Chef 'chef_type' => 'webui_user', 'salt' => nil, 'password' => nil, - 'openid' => nil - }) + 'openid' => nil, + },) end def preserve_key?(key) diff --git a/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb b/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb index 1ac03166c2..d2e0e64afe 100644 --- a/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb @@ -147,7 +147,7 @@ class Chef # /environments EnvironmentsDir.new("environments", self, nil, Chef::ChefFS::DataHandler::EnvironmentDataHandler.new), # /roles - RestListDir.new("roles", self, nil, Chef::ChefFS::DataHandler::RoleDataHandler.new) + RestListDir.new("roles", self, nil, Chef::ChefFS::DataHandler::RoleDataHandler.new), ] if repo_mode == 'hosted_everything' result += [ @@ -179,7 +179,7 @@ class Chef # /nodes NodesDir.new("nodes", self, nil, Chef::ChefFS::DataHandler::NodeDataHandler.new), # /users - RestListDir.new("users", self, nil, Chef::ChefFS::DataHandler::UserDataHandler.new) + RestListDir.new("users", self, nil, Chef::ChefFS::DataHandler::UserDataHandler.new), ] end result.sort_by { |child| child.name } diff --git a/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb b/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb index 51de0bfd86..b888b6de22 100644 --- a/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb @@ -58,7 +58,7 @@ class Chef :files => { :recursive => true }, :resources => { :ruby_only => true, :recursive => true }, :providers => { :ruby_only => true, :recursive => true }, - :root_files => { } + :root_files => { }, } # See Erchef code diff --git a/lib/chef/client.rb b/lib/chef/client.rb index 9d9909bac2..4c06d513c1 100644 --- a/lib/chef/client.rb +++ b/lib/chef/client.rb @@ -391,7 +391,7 @@ class Chef def register_reporters [ Chef::ResourceReporter.new(rest), - Chef::Audit::AuditReporter.new(rest) + Chef::Audit::AuditReporter.new(rest), ].each do |r| events.register(r) end diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb index dbccdbc0a8..0341c394a8 100644 --- a/lib/chef/cookbook/cookbook_version_loader.rb +++ b/lib/chef/cookbook/cookbook_version_loader.rb @@ -51,7 +51,7 @@ class Chef :library_filenames => {}, :resource_filenames => {}, :provider_filenames => {}, - :root_filenames => {} + :root_filenames => {}, } @metadata_filenames = [] diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb index 0892d85749..67d762f34b 100644 --- a/lib/chef/cookbook/metadata.rb +++ b/lib/chef/cookbook/metadata.rb @@ -176,7 +176,7 @@ class Chef set_or_return( :maintainer, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -191,7 +191,7 @@ class Chef set_or_return( :maintainer_email, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -206,7 +206,7 @@ class Chef set_or_return( :license, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -221,7 +221,7 @@ class Chef set_or_return( :description, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -236,7 +236,7 @@ class Chef set_or_return( :long_description, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -267,7 +267,7 @@ class Chef set_or_return( :name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -490,8 +490,8 @@ class Chef :default => { :kind_of => [ String, Array, Hash, Symbol, Numeric, TrueClass, FalseClass ] }, :source_url => { :kind_of => String }, :issues_url => { :kind_of => String }, - :privacy => { :kind_of => [ TrueClass, FalseClass ] } - } + :privacy => { :kind_of => [ TrueClass, FalseClass ] }, + }, ) options[:required] = remap_required_attribute(options[:required]) unless options[:required].nil? validate_choice_array(options) @@ -507,8 +507,8 @@ class Chef options, { :title => { :kind_of => String }, - :description => { :kind_of => String } - } + :description => { :kind_of => String }, + }, ) @groupings[name] = options @groupings[name] @@ -571,7 +571,7 @@ class Chef ISSUES_URL => self.issues_url, PRIVACY => self.privacy, CHEF_VERSIONS => gem_requirements_to_array(*self.chef_versions), - OHAI_VERSIONS => gem_requirements_to_array(*self.ohai_versions) + OHAI_VERSIONS => gem_requirements_to_array(*self.ohai_versions), } end @@ -647,7 +647,7 @@ class Chef set_or_return( :source_url, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -662,7 +662,7 @@ class Chef set_or_return( :issues_url, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -679,7 +679,7 @@ class Chef set_or_return( :privacy, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end diff --git a/lib/chef/cookbook_manifest.rb b/lib/chef/cookbook_manifest.rb index 10654a4945..27daf287a1 100644 --- a/lib/chef/cookbook_manifest.rb +++ b/lib/chef/cookbook_manifest.rb @@ -193,8 +193,8 @@ class Chef :templates => Array.new, :resources => Array.new, :providers => Array.new, - :root_files => Array.new - }) + :root_files => Array.new, + },) @checksums = {} if !root_paths || root_paths.size == 0 @@ -215,8 +215,8 @@ class Chef :name => file_name, :path => path, :checksum => csum, - :specificity => specificity - }) + :specificity => specificity, + },) manifest[segment] << rs end diff --git a/lib/chef/data_bag.rb b/lib/chef/data_bag.rb index 9d0dc53da5..102851b804 100644 --- a/lib/chef/data_bag.rb +++ b/lib/chef/data_bag.rb @@ -52,7 +52,7 @@ class Chef set_or_return( :name, arg, - :regex => VALID_NAME + :regex => VALID_NAME, ) end diff --git a/lib/chef/data_bag_item.rb b/lib/chef/data_bag_item.rb index b0713c298f..fd9548eaec 100644 --- a/lib/chef/data_bag_item.rb +++ b/lib/chef/data_bag_item.rb @@ -86,7 +86,7 @@ class Chef set_or_return( :data_bag, arg, - :regex => /^[\-[:alnum:]_]+$/ + :regex => /^[\-[:alnum:]_]+$/, ) end @@ -120,7 +120,7 @@ class Chef "json_class" => self.class.name, "chef_type" => "data_bag_item", "data_bag" => data_bag, - "raw_data" => raw_data + "raw_data" => raw_data, } Chef::JSONCompat.to_json(result, *a) end diff --git a/lib/chef/dsl/audit.rb b/lib/chef/dsl/audit.rb index d1bf09b313..569c8a3bc5 100644 --- a/lib/chef/dsl/audit.rb +++ b/lib/chef/dsl/audit.rb @@ -40,7 +40,7 @@ class Chef cookbook_name: cookbook_name, cookbook_version: self.run_context.cookbook_collection[cookbook_name].version, recipe_name: self.recipe_name, - line_number: block.source_location[1] + line_number: block.source_location[1], } run_context.audits[name] = Struct.new(:args, :block, :metadata).new(args, block, metadata) diff --git a/lib/chef/dsl/declare_resource.rb b/lib/chef/dsl/declare_resource.rb index 52b0cb715d..93e7e69884 100644 --- a/lib/chef/dsl/declare_resource.rb +++ b/lib/chef/dsl/declare_resource.rb @@ -100,7 +100,7 @@ class Chef run_context: run_context, cookbook_name: cookbook_name, recipe_name: recipe_name, - enclosing_provider: self.is_a?(Chef::Provider) ? self : nil + enclosing_provider: self.is_a?(Chef::Provider) ? self : nil, ).build(&resource_attrs_block) end end diff --git a/lib/chef/encrypted_data_bag_item/encryptor.rb b/lib/chef/encrypted_data_bag_item/encryptor.rb index 034413c1bd..14c82dcea9 100644 --- a/lib/chef/encrypted_data_bag_item/encryptor.rb +++ b/lib/chef/encrypted_data_bag_item/encryptor.rb @@ -83,7 +83,7 @@ class Chef::EncryptedDataBagItem "encrypted_data" => encrypted_data, "iv" => Base64.encode64(iv), "version" => 1, - "cipher" => algorithm + "cipher" => algorithm, } end @@ -141,7 +141,7 @@ class Chef::EncryptedDataBagItem "hmac" => hmac, "iv" => Base64.encode64(iv), "version" => 2, - "cipher" => algorithm + "cipher" => algorithm, } end @@ -176,7 +176,7 @@ class Chef::EncryptedDataBagItem "iv" => Base64.encode64(iv), "auth_tag" => Base64.encode64(auth_tag), "version" => 3, - "cipher" => algorithm + "cipher" => algorithm, } end diff --git a/lib/chef/environment.rb b/lib/chef/environment.rb index 5612978a08..aedccbb08d 100644 --- a/lib/chef/environment.rb +++ b/lib/chef/environment.rb @@ -67,7 +67,7 @@ class Chef set_or_return( :description, arg, - :kind_of => String + :kind_of => String, ) end @@ -75,7 +75,7 @@ class Chef set_or_return( :default_attributes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -87,7 +87,7 @@ class Chef set_or_return( :override_attributes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -103,8 +103,8 @@ class Chef :kind_of => Hash, :callbacks => { "should be a valid set of cookbook version requirements" => lambda { |cv| Chef::Environment.validate_cookbook_versions(cv) } - } - } + }, + }, ) end @@ -115,7 +115,7 @@ class Chef :version => { :callbacks => { "should be a valid version requirement" => lambda { |v| Chef::Environment.validate_cookbook_version(v) } } } - }) + },) @cookbook_versions[cookbook] = version end @@ -127,7 +127,7 @@ class Chef "json_class" => self.class.name, "chef_type" => "environment", "default_attributes" => @default_attributes, - "override_attributes" => @override_attributes + "override_attributes" => @override_attributes, } result end diff --git a/lib/chef/event_loggers/windows_eventlog.rb b/lib/chef/event_loggers/windows_eventlog.rb index 7a3a28b61f..9c01b11e76 100644 --- a/lib/chef/event_loggers/windows_eventlog.rb +++ b/lib/chef/event_loggers/windows_eventlog.rb @@ -50,7 +50,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => RUN_START_EVENT_ID, - :data => [version] + :data => [version], ) end @@ -60,7 +60,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => RUN_STARTED_EVENT_ID, - :data => [run_status.run_id] + :data => [run_status.run_id], ) end @@ -69,7 +69,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => RUN_COMPLETED_EVENT_ID, - :data => [@run_status.run_id, @run_status.elapsed_time.to_s] + :data => [@run_status.run_id, @run_status.elapsed_time.to_s], ) end @@ -92,7 +92,7 @@ class Chef :event_id => RUN_FAILED_EVENT_ID, :data => data + [e.class.name, e.message, - e.backtrace.join("\n")] + e.backtrace.join("\n")], ) end diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index 8736ff7ffc..74b8d80de2 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -344,7 +344,7 @@ class Chef result = { "message" => message, "non_existent_cookbooks" => non_existent_cookbooks, - "cookbooks_with_no_versions" => cookbooks_with_no_matching_versions + "cookbooks_with_no_versions" => cookbooks_with_no_matching_versions, } Chef::JSONCompat.to_json(result, *a) end @@ -379,7 +379,7 @@ class Chef "message" => message, "unsatisfiable_run_list_item" => run_list_item, "non_existent_cookbooks" => non_existent_cookbooks, - "most_constrained_cookbooks" => most_constrained_cookbooks + "most_constrained_cookbooks" => most_constrained_cookbooks, } Chef::JSONCompat.to_json(result, *a) end diff --git a/lib/chef/file_cache.rb b/lib/chef/file_cache.rb index c2f77bdff6..2d633af4ed 100644 --- a/lib/chef/file_cache.rb +++ b/lib/chef/file_cache.rb @@ -43,12 +43,12 @@ class Chef validate( { :path => path, - :contents => contents + :contents => contents, }, { :path => { :kind_of => String }, :contents => { :kind_of => String }, - } + }, ) file_path_array = File.split(path) @@ -69,12 +69,12 @@ class Chef validate( { :file => file, - :path => path + :path => path, }, { :file => { :kind_of => String }, :path => { :kind_of => String }, - } + }, ) file_path_array = File.split(path) @@ -82,7 +82,7 @@ class Chef if File.exists?(file) && File.writable?(file) FileUtils.mv( file, - File.join(create_cache_path(File.join(file_path_array), true), file_name) + File.join(create_cache_path(File.join(file_path_array), true), file_name), ) else raise RuntimeError, "Cannot move #{file} to #{path}!" @@ -109,7 +109,7 @@ class Chef }, { :path => { :kind_of => String } - } + }, ) cache_path = create_cache_path(path, false) raise Chef::Exceptions::FileNotFound, "Cannot find #{cache_path} for #{path}!" unless File.exists?(cache_path) @@ -134,8 +134,8 @@ class Chef :path => path }, { - :path => { :kind_of => String }, - } + :path => { :kind_of => String } + }, ) cache_path = create_cache_path(path, false) if File.exists?(cache_path) @@ -181,8 +181,8 @@ class Chef :path => path }, { - :path => { :kind_of => String }, - } + :path => { :kind_of => String } + }, ) full_path = create_cache_path(path, false) if File.exists?(full_path) diff --git a/lib/chef/formatters/error_descriptor.rb b/lib/chef/formatters/error_descriptor.rb index c2e656f167..f0e7520f31 100644 --- a/lib/chef/formatters/error_descriptor.rb +++ b/lib/chef/formatters/error_descriptor.rb @@ -49,7 +49,7 @@ class Chef def for_json() { 'title' => @title, - 'sections' => @sections + 'sections' => @sections, } end diff --git a/lib/chef/key.rb b/lib/chef/key.rb index 47bfe1fcee..714dfc3f60 100644 --- a/lib/chef/key.rb +++ b/lib/chef/key.rb @@ -250,7 +250,7 @@ class Chef openssl_key_object = OpenSSL::PKey::RSA.new(public_key) data_string = OpenSSL::ASN1::Sequence([ OpenSSL::ASN1::Integer.new(openssl_key_object.public_key.n), - OpenSSL::ASN1::Integer.new(openssl_key_object.public_key.e) + OpenSSL::ASN1::Integer.new(openssl_key_object.public_key.e), ]) OpenSSL::Digest::SHA1.hexdigest(data_string.to_der).scan(/../).join(':') end diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index d958ddf336..a429c7246b 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -259,7 +259,7 @@ class Chef ) @chef_vault_handler = Chef::Knife::Bootstrap::ChefVaultHandler.new( knife_config: config, - ui: ui + ui: ui, ) end @@ -340,7 +340,7 @@ class Chef config, config[:run_list], Chef::Config, - secret + secret, ) end diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb index 043ca84a58..c125c4b939 100644 --- a/lib/chef/knife/cookbook_site_share.rb +++ b/lib/chef/knife/cookbook_site_share.rb @@ -129,7 +129,7 @@ class Chef http_resp = Chef::CookbookSiteStreamingUploader.post(uri, user_id, user_secret_filename, { :tarball => File.open(cookbook_filename), - :cookbook => category_string + :cookbook => category_string, }) res = Chef::JSONCompat.from_json(http_resp.body) diff --git a/lib/chef/log/winevt.rb b/lib/chef/log/winevt.rb index c5b7c3485a..84ae80b634 100644 --- a/lib/chef/log/winevt.rb +++ b/lib/chef/log/winevt.rb @@ -54,7 +54,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => INFO_EVENT_ID, - :data => [msg] + :data => [msg], ) end @@ -63,7 +63,7 @@ class Chef :event_type => ::Win32::EventLog::WARN_TYPE, :source => SOURCE, :event_id => WARN_EVENT_ID, - :data => [msg] + :data => [msg], ) end @@ -72,7 +72,7 @@ class Chef :event_type => ::Win32::EventLog::INFO_TYPE, :source => SOURCE, :event_id => DEBUG_EVENT_ID, - :data => [msg] + :data => [msg], ) end @@ -81,7 +81,7 @@ class Chef :event_type => ::Win32::EventLog::ERROR_TYPE, :source => SOURCE, :event_id => ERROR_EVENT_ID, - :data => [msg] + :data => [msg], ) end @@ -90,7 +90,7 @@ class Chef :event_type => ::Win32::EventLog::ERROR_TYPE, :source => SOURCE, :event_id => FATAL_EVENT_ID, - :data => [msg] + :data => [msg], ) end diff --git a/lib/chef/mixin/powershell_out.rb b/lib/chef/mixin/powershell_out.rb index e4f29c07c4..7ec2a5cb40 100644 --- a/lib/chef/mixin/powershell_out.rb +++ b/lib/chef/mixin/powershell_out.rb @@ -66,7 +66,7 @@ class Chef with_os_architecture(nil, architecture: arch) do shell_out( build_powershell_command(script), - options + options, ) end end @@ -88,7 +88,7 @@ class Chef "-ExecutionPolicy Unrestricted", # Powershell will hang if STDIN is redirected # http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected - "-InputFormat None" + "-InputFormat None", ] "powershell.exe #{flags.join(' ')} -Command \"#{script}\"" diff --git a/lib/chef/mixin/powershell_type_coercions.rb b/lib/chef/mixin/powershell_type_coercions.rb index 75b3276c84..3297d6abbb 100644 --- a/lib/chef/mixin/powershell_type_coercions.rb +++ b/lib/chef/mixin/powershell_type_coercions.rb @@ -28,7 +28,7 @@ class Chef FalseClass => { :type => lambda { |x| '$false' }}, TrueClass => { :type => lambda { |x| '$true' }}, Hash => {:type => Proc.new { |x| translate_hash(x)}}, - Array => {:type => Proc.new { |x| translate_array(x)}} + Array => {:type => Proc.new { |x| translate_array(x)}}, } end diff --git a/lib/chef/mixin/securable.rb b/lib/chef/mixin/securable.rb index 396243693e..e0d3752733 100644 --- a/lib/chef/mixin/securable.rb +++ b/lib/chef/mixin/securable.rb @@ -24,7 +24,7 @@ class Chef set_or_return( :owner, arg, - :regex => Chef::Config[:user_valid_regex] + :regex => Chef::Config[:user_valid_regex], ) end @@ -34,7 +34,7 @@ class Chef set_or_return( :group, arg, - :regex => Chef::Config[:group_valid_regex] + :regex => Chef::Config[:group_valid_regex], ) end @@ -54,8 +54,8 @@ class Chef else Integer(m)<=07777 && Integer(m)>=0 end - }, - } + } + }, ) end @@ -116,7 +116,7 @@ class Chef unless permissions.nil? input = { :permissions => permissions, - :principals => principals + :principals => principals, } input.merge!(args_hash) unless args_hash.nil? @@ -124,7 +124,7 @@ class Chef :principals => { :required => true, :kind_of => [String, Array] }, :applies_to_children => { :equal_to => [ true, false, :containers_only, :objects_only ]}, :applies_to_self => { :kind_of => [ TrueClass, FalseClass ] }, - :one_level_deep => { :kind_of => [ TrueClass, FalseClass ] } + :one_level_deep => { :kind_of => [ TrueClass, FalseClass ] }, } validate(input, validations) @@ -158,7 +158,7 @@ class Chef set_or_return( name, rights, - {} + {}, ) end end @@ -174,7 +174,7 @@ class Chef set_or_return( :inherits, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end end diff --git a/lib/chef/node.rb b/lib/chef/node.rb index cb486f8d09..e2f3ec4fc0 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -115,7 +115,7 @@ class Chef {:name => { :kind_of => String, :cannot_be => :blank, :regex => /^[\-[:alnum:]_:.]+$/} - }) + },) @name = arg else @name @@ -507,7 +507,7 @@ class Chef "default" => attributes.combined_default, "override" => attributes.combined_override, #Render correctly for run_list items so malformed json does not result - "run_list" => @primary_runlist.run_list.map { |item| item.to_s } + "run_list" => @primary_runlist.run_list.map { |item| item.to_s }, } # Chef Server rejects node JSON with extra keys; prior to 12.3, # "policy_name" and "policy_group" are unknown; after 12.3 they are diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb index 7ffac40bf4..862a7a2fd9 100644 --- a/lib/chef/node/attribute.rb +++ b/lib/chef/node/attribute.rb @@ -48,21 +48,21 @@ class Chef :@role_override, :@env_override, :@force_override, - :@automatic + :@automatic, ].freeze DEFAULT_COMPONENTS = [ :@default, :@env_default, :@role_default, - :@force_default + :@force_default, ] OVERRIDE_COMPONENTS = [ :@override, :@role_override, :@env_override, - :@force_override + :@force_override, ] [:all?, diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb index 1dcc950c6e..6a45f49140 100644 --- a/lib/chef/node/attribute_collections.rb +++ b/lib/chef/node/attribute_collections.rb @@ -54,7 +54,7 @@ class Chef :sort!, :sort_by!, :uniq!, - :unshift + :unshift, ] # For all of the methods that may mutate an Array, we override them to @@ -117,7 +117,7 @@ class Chef :reject!, :replace, :select!, - :shift + :shift, ] # For all of the mutating methods on Mash, override them so that they diff --git a/lib/chef/node/immutable_collections.rb b/lib/chef/node/immutable_collections.rb index 0e2800641a..c092c8cacc 100644 --- a/lib/chef/node/immutable_collections.rb +++ b/lib/chef/node/immutable_collections.rb @@ -63,7 +63,7 @@ class Chef :sort!, :sort_by!, :uniq!, - :unshift + :unshift, ] def initialize(array_data) @@ -143,7 +143,7 @@ class Chef :reject!, :replace, :select!, - :shift + :shift, ] def initialize(mash_data) diff --git a/lib/chef/org.rb b/lib/chef/org.rb index 81eca6a991..ff0d2de390 100644 --- a/lib/chef/org.rb +++ b/lib/chef/org.rb @@ -61,7 +61,7 @@ class Chef def to_hash result = { "name" => @name, - "full_name" => @full_name + "full_name" => @full_name, } result["private_key"] = @private_key if @private_key result["guid"] = @guid if @guid diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb index 1de6d61029..a4811ccc33 100644 --- a/lib/chef/platform/provider_mapping.rb +++ b/lib/chef/platform/provider_mapping.rb @@ -119,12 +119,12 @@ class Chef :required => false, }, :resource => { - :kind_of => Symbol, + :kind_of => Symbol }, :provider => { - :kind_of => [ String, Symbol, Class ], - } - } + :kind_of => [ String, Symbol, Class ] + }, + }, ) if args.has_key?(:platform) if args.has_key?(:version) diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb index 432fe3987f..3095ff63e0 100644 --- a/lib/chef/provider/dsc_resource.rb +++ b/lib/chef/provider/dsc_resource.rb @@ -72,7 +72,7 @@ class Chef def local_configuration_manager @local_configuration_manager ||= Chef::Util::DSC::LocalConfigurationManager.new( node, - nil + nil, ) end @@ -152,7 +152,7 @@ class Chef cmdlet = Chef::Util::Powershell::Cmdlet.new( node, "Invoke-DscResource #{switches}", - output_format + output_format, ) cmdlet.run!({}, {:timeout => new_resource.timeout}) end @@ -170,7 +170,7 @@ class Chef def create_reboot_resource @reboot_resource = Chef::Resource::Reboot.new( "Reboot for #{@new_resource.name}", - run_context + run_context, ).tap do |r| r.reason("Reboot for #{@new_resource.resource}.") end diff --git a/lib/chef/provider/dsc_script.rb b/lib/chef/provider/dsc_script.rb index 8205910d5a..ea47ff22b3 100644 --- a/lib/chef/provider/dsc_script.rb +++ b/lib/chef/provider/dsc_script.rb @@ -92,7 +92,7 @@ class Chef shellout_flags = { :cwd => @dsc_resource.cwd, :environment => @dsc_resource.environment, - :timeout => @dsc_resource.timeout + :timeout => @dsc_resource.timeout, } begin @@ -119,7 +119,7 @@ class Chef shellout_flags = { :cwd => @dsc_resource.cwd, :environment => @dsc_resource.environment, - :timeout => @dsc_resource.timeout + :timeout => @dsc_resource.timeout, } generator = Chef::Util::DSC::ConfigurationGenerator.new(@run_context.node, config_directory) diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb index 4d9f07d2b2..85bc2d98be 100644 --- a/lib/chef/provider/file.rb +++ b/lib/chef/provider/file.rb @@ -246,7 +246,7 @@ class Chef else [ Chef::Exceptions::FileTypeMismatch, "File #{path} exists, but is a #{file_type_string(@new_resource.path)}, set force_unlink to true to remove", - "Assuming #{file_type_string(@new_resource.path)} at #{@new_resource.path} would have been removed by a previous resource" + "Assuming #{file_type_string(@new_resource.path)} at #{@new_resource.path} would have been removed by a previous resource", ] end end @@ -267,7 +267,7 @@ class Chef [ Chef::Exceptions::FileTypeMismatch, "File #{path} exists, but is a symlink to #{real_path} which is a #{file_type_string(real_path)}. " + "Disable manage_symlink_source and set force_unlink to remove it.", - "Assuming symlink #{path} or source file #{real_path} would have been fixed by a previous resource" + "Assuming symlink #{path} or source file #{real_path} would have been fixed by a previous resource", ] end rescue Errno::ELOOP diff --git a/lib/chef/provider/http_request.rb b/lib/chef/provider/http_request.rb index 61aff434ed..dac62bc2f6 100644 --- a/lib/chef/provider/http_request.rb +++ b/lib/chef/provider/http_request.rb @@ -42,7 +42,7 @@ class Chef # and false for a "304 Not Modified" response modified = @http.head( "#{@new_resource.url}", - @new_resource.headers + @new_resource.headers, ) Chef::Log.info("#{@new_resource} HEAD to #{@new_resource.url} successful") Chef::Log.debug("#{@new_resource} HEAD request response: #{modified}") @@ -59,7 +59,7 @@ class Chef message = check_message(@new_resource.message) body = @http.get( "#{@new_resource.url}", - @new_resource.headers + @new_resource.headers, ) Chef::Log.info("#{@new_resource} GET to #{@new_resource.url} successful") Chef::Log.debug("#{@new_resource} GET request response: #{body}") @@ -73,7 +73,7 @@ class Chef body = @http.put( "#{@new_resource.url}", message, - @new_resource.headers + @new_resource.headers, ) Chef::Log.info("#{@new_resource} PUT to #{@new_resource.url} successful") Chef::Log.debug("#{@new_resource} PUT request response: #{body}") @@ -87,7 +87,7 @@ class Chef body = @http.post( "#{@new_resource.url}", message, - @new_resource.headers + @new_resource.headers, ) Chef::Log.info("#{@new_resource} POST to #{@new_resource.url} message: #{message.inspect} successful") Chef::Log.debug("#{@new_resource} POST request response: #{body}") @@ -99,7 +99,7 @@ class Chef converge_by("#{@new_resource} DELETE to #{@new_resource.url}") do body = @http.delete( "#{@new_resource.url}", - @new_resource.headers + @new_resource.headers, ) @new_resource.updated_by_last_action(true) Chef::Log.info("#{@new_resource} DELETE to #{@new_resource.url} successful") diff --git a/lib/chef/provider/ifconfig.rb b/lib/chef/provider/ifconfig.rb index 7869917307..9ec2533ac0 100644 --- a/lib/chef/provider/ifconfig.rb +++ b/lib/chef/provider/ifconfig.rb @@ -109,7 +109,7 @@ class Chef command = add_command converge_by ("run #{command} to add #{@new_resource}") do run_command( - :command => command + :command => command, ) Chef::Log.info("#{@new_resource} added") end @@ -127,7 +127,7 @@ class Chef command = enable_command converge_by ("run #{command} to enable #{@new_resource}") do run_command( - :command => command + :command => command, ) Chef::Log.info("#{@new_resource} enabled") end @@ -141,7 +141,7 @@ class Chef command = delete_command converge_by ("run #{command} to delete #{@new_resource}") do run_command( - :command => command + :command => command, ) Chef::Log.info("#{@new_resource} deleted") end @@ -158,7 +158,7 @@ class Chef command = disable_command converge_by ("run #{command} to disable #{@new_resource}") do run_command( - :command => command + :command => command, ) Chef::Log.info("#{@new_resource} disabled") end diff --git a/lib/chef/provider/osx_profile.rb b/lib/chef/provider/osx_profile.rb index 085397efea..4b3e512480 100644 --- a/lib/chef/provider/osx_profile.rb +++ b/lib/chef/provider/osx_profile.rb @@ -148,15 +148,15 @@ class Chef ::File.join( "profiles", @new_resource.cookbook_name, - ::File.dirname(cookbook_file) + ::File.dirname(cookbook_file), ) ) remote_file = Chef::Resource::CookbookFile.new( ::File.join( get_cache_dir, - "#{cookbook_file}.remote" + "#{cookbook_file}.remote", ), - run_context + run_context, ) remote_file.cookbook_name = @new_resource.cookbook_name remote_file.source(cookbook_file) @@ -177,7 +177,7 @@ class Chef # Make a UUID of the profile contents and return as string UUIDTools::UUID.sha1_create( UUIDTools::UUID_DNS_NAMESPACE, - profile.to_s + profile.to_s, ).to_s end diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb index 7a9173e077..45e2a2fc84 100644 --- a/lib/chef/provider/package/chocolatey.rb +++ b/lib/chef/provider/package/chocolatey.rb @@ -142,7 +142,7 @@ class Chef "[System.Environment]::GetEnvironmentVariable('ChocolateyInstall', 'MACHINE')" ).stdout.chomp, 'bin', - 'choco.exe' + 'choco.exe', ) end diff --git a/lib/chef/provider/package/windows/exe.rb b/lib/chef/provider/package/windows/exe.rb index 8f6cd1efa5..f21106f2ff 100644 --- a/lib/chef/provider/package/windows/exe.rb +++ b/lib/chef/provider/package/windows/exe.rb @@ -61,7 +61,7 @@ class Chef "\"#{new_resource.source}\"", unattended_flags, expand_options(new_resource.options), - "& exit %%%%ERRORLEVEL%%%%" + "& exit %%%%ERRORLEVEL%%%%", ].join(" "), timeout: new_resource.timeout, returns: new_resource.returns ) end @@ -86,7 +86,7 @@ class Chef ::File.basename(uninstall_string), expand_options(new_resource.options), " ", - unattended_flags + unattended_flags, ].join %Q{start "" /wait #{uninstall_string} & exit %%%%ERRORLEVEL%%%%} end diff --git a/lib/chef/provider/package/windows/registry_uninstall_entry.rb b/lib/chef/provider/package/windows/registry_uninstall_entry.rb index a63e09c6bd..2c3f6ba093 100644 --- a/lib/chef/provider/package/windows/registry_uninstall_entry.rb +++ b/lib/chef/provider/package/windows/registry_uninstall_entry.rb @@ -31,7 +31,7 @@ class Chef [ [::Win32::Registry::HKEY_LOCAL_MACHINE, (::Win32::Registry::Constants::KEY_READ | 0x0100)], [::Win32::Registry::HKEY_LOCAL_MACHINE, (::Win32::Registry::Constants::KEY_READ | 0x0200)], - [::Win32::Registry::HKEY_CURRENT_USER] + [::Win32::Registry::HKEY_CURRENT_USER], ].each do |hkey| desired = hkey.length > 1 ? hkey[1] : ::Win32::Registry::Constants::KEY_READ begin diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb index e04efb6b42..a5b0a5dc24 100644 --- a/lib/chef/provider/powershell_script.rb +++ b/lib/chef/provider/powershell_script.rb @@ -131,7 +131,7 @@ EOH "-ExecutionPolicy #{execution_policy}", # Powershell will hang if STDIN is redirected # http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected - "-InputFormat None" + "-InputFormat None", ] end diff --git a/lib/chef/provider/reboot.rb b/lib/chef/provider/reboot.rb index 22e77dcc13..ab3177ba65 100644 --- a/lib/chef/provider/reboot.rb +++ b/lib/chef/provider/reboot.rb @@ -40,7 +40,7 @@ class Chef :delay_mins => @new_resource.delay_mins, :reason => @new_resource.reason, :timestamp => Time.now, - :requested_by => @new_resource.name + :requested_by => @new_resource.name, ) end diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb index f5c370246c..fcebeeb6c6 100644 --- a/lib/chef/provider/service/windows.rb +++ b/lib/chef/provider/service/windows.rb @@ -305,7 +305,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service Chef::Log.debug "#{@new_resource.name} setting start_type to #{type}" Win32::Service.configure( :service_name => @new_resource.service_name, - :start_type => allowed_types[type] + :start_type => allowed_types[type], ) @new_resource.updated_by_last_action(true) end diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb index 5b506daf81..78769ae758 100644 --- a/lib/chef/provider/user/dscl.rb +++ b/lib/chef/provider/user/dscl.rb @@ -416,7 +416,7 @@ user password using shadow hash.") salt, iterations, 128, - OpenSSL::Digest::SHA512.new + OpenSSL::Digest::SHA512.new, ) end @@ -570,7 +570,7 @@ user password using shadow hash.") :comment => "realname", :password => "passwd", :auth_authority => "authentication_authority", - :shadow_hash => "ShadowHashData" + :shadow_hash => "ShadowHashData", }.freeze # Directory where the user plist files are stored for versions 10.7 and above @@ -701,7 +701,7 @@ user password using shadow hash.") salt, current_resource.iterations, 128, - OpenSSL::Digest::SHA512.new + OpenSSL::Digest::SHA512.new, ).unpack('H*').first == current_resource.password end diff --git a/lib/chef/provider/user/pw.rb b/lib/chef/provider/user/pw.rb index 810ffb9a8d..e53d647f37 100644 --- a/lib/chef/provider/user/pw.rb +++ b/lib/chef/provider/user/pw.rb @@ -75,7 +75,7 @@ class Chef 'home' => "-d", 'gid' => "-g", 'uid' => "-u", - 'shell' => "-s" + 'shell' => "-s", } field_list.sort{ |a,b| a[0] <=> b[0] }.each do |field, option| field_symbol = field.to_sym diff --git a/lib/chef/provider/user/windows.rb b/lib/chef/provider/user/windows.rb index 76519bb498..b0b2d7e956 100644 --- a/lib/chef/provider/user/windows.rb +++ b/lib/chef/provider/user/windows.rb @@ -105,7 +105,7 @@ class Chef 'home' => 'home_dir', 'uid' => 'user_id', 'shell' => 'script_path', - 'password' => 'password' + 'password' => 'password', } field_list.sort{ |a,b| a[0] <=> b[0] }.each do |field, option| diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index 42d91a056a..9da79d38e3 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -173,7 +173,7 @@ class Chef arg.each do |action| validate( { action: action }, - { action: { kind_of: Symbol, equal_to: allowed_actions } } + { action: { kind_of: Symbol, equal_to: allowed_actions } }, ) end @action = arg @@ -674,7 +674,7 @@ class Chef end { 'json_class' => self.class.name, - 'instance_vars' => instance_vars + 'instance_vars' => instance_vars, } end diff --git a/lib/chef/resource/cron.rb b/lib/chef/resource/cron.rb index 70c2dd89a3..7a4e3f6988 100644 --- a/lib/chef/resource/cron.rb +++ b/lib/chef/resource/cron.rb @@ -60,7 +60,7 @@ class Chef set_or_return( :minute, converted_arg, - :kind_of => String + :kind_of => String, ) end @@ -77,7 +77,7 @@ class Chef set_or_return( :hour, converted_arg, - :kind_of => String + :kind_of => String, ) end @@ -94,7 +94,7 @@ class Chef set_or_return( :day, converted_arg, - :kind_of => String + :kind_of => String, ) end @@ -111,7 +111,7 @@ class Chef set_or_return( :month, converted_arg, - :kind_of => String + :kind_of => String, ) end @@ -135,7 +135,7 @@ class Chef set_or_return( :weekday, converted_arg, - :kind_of => [String, Symbol] + :kind_of => [String, Symbol], ) end @@ -143,7 +143,7 @@ class Chef set_or_return( :time, arg, - :equal_to => Chef::Provider::Cron::SPECIAL_TIME_VALUES + :equal_to => Chef::Provider::Cron::SPECIAL_TIME_VALUES, ) end @@ -151,7 +151,7 @@ class Chef set_or_return( :mailto, arg, - :kind_of => String + :kind_of => String, ) end @@ -159,7 +159,7 @@ class Chef set_or_return( :path, arg, - :kind_of => String + :kind_of => String, ) end @@ -167,7 +167,7 @@ class Chef set_or_return( :home, arg, - :kind_of => String + :kind_of => String, ) end @@ -175,7 +175,7 @@ class Chef set_or_return( :shell, arg, - :kind_of => String + :kind_of => String, ) end @@ -183,7 +183,7 @@ class Chef set_or_return( :command, arg, - :kind_of => String + :kind_of => String, ) end @@ -191,7 +191,7 @@ class Chef set_or_return( :user, arg, - :kind_of => String + :kind_of => String, ) end @@ -199,7 +199,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => Hash + :kind_of => Hash, ) end diff --git a/lib/chef/resource/deploy.rb b/lib/chef/resource/deploy.rb index 5df46fff60..01300cf512 100644 --- a/lib/chef/resource/deploy.rb +++ b/lib/chef/resource/deploy.rb @@ -103,7 +103,7 @@ class Chef set_or_return( :depth, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end @@ -112,7 +112,7 @@ class Chef set_or_return( :deploy_to, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -120,7 +120,7 @@ class Chef set_or_return( :repo, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end alias :repository :repo @@ -129,7 +129,7 @@ class Chef set_or_return( :remote, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -137,7 +137,7 @@ class Chef set_or_return( :role, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -146,7 +146,7 @@ class Chef set_or_return( :restart_command, arg, - :kind_of => [ String, Proc ] + :kind_of => [ String, Proc ], ) end alias :restart :restart_command @@ -155,7 +155,7 @@ class Chef set_or_return( :migrate, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -163,7 +163,7 @@ class Chef set_or_return( :migration_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -171,7 +171,7 @@ class Chef set_or_return( :rollback_on_error, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -179,7 +179,7 @@ class Chef set_or_return( :user, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -187,7 +187,7 @@ class Chef set_or_return( :group, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -195,7 +195,7 @@ class Chef set_or_return( :enable_submodules, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -203,7 +203,7 @@ class Chef set_or_return( :shallow_clone, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -211,7 +211,7 @@ class Chef set_or_return( :repository_cache, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -219,7 +219,7 @@ class Chef set_or_return( :copy_exclude, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -227,7 +227,7 @@ class Chef set_or_return( :revision, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end alias :branch :revision @@ -236,7 +236,7 @@ class Chef set_or_return( :git_ssh_wrapper, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end alias :ssh_wrapper :git_ssh_wrapper @@ -245,7 +245,7 @@ class Chef set_or_return( :svn_username, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -253,7 +253,7 @@ class Chef set_or_return( :svn_password, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -261,7 +261,7 @@ class Chef set_or_return( :svn_arguments, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -281,7 +281,7 @@ class Chef set_or_return( :scm_provider, klass, - :kind_of => [ Class ] + :kind_of => [ Class ], ) end @@ -295,7 +295,7 @@ class Chef set_or_return( :svn_force_export, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -308,7 +308,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -328,7 +328,7 @@ class Chef set_or_return( :purge_before_symlink, arg, - :kind_of => Array + :kind_of => Array, ) end @@ -344,7 +344,7 @@ class Chef set_or_return( :create_dirs_before_symlink, arg, - :kind_of => Array + :kind_of => Array, ) end @@ -358,7 +358,7 @@ class Chef set_or_return( :symlinks, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -373,7 +373,7 @@ class Chef set_or_return( :symlink_before_migrate, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -405,7 +405,7 @@ class Chef set_or_return( :additional_remotes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -413,7 +413,7 @@ class Chef set_or_return( :enable_checkout, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -421,7 +421,7 @@ class Chef set_or_return( :checkout_branch, arg, - :kind_of => String + :kind_of => String, ) end @@ -434,7 +434,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => Integer + :kind_of => Integer, ) end diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb index 9cac2ce243..b16caaf4b8 100644 --- a/lib/chef/resource/directory.rb +++ b/lib/chef/resource/directory.rb @@ -45,7 +45,7 @@ class Chef set_or_return( :recursive, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -53,7 +53,7 @@ class Chef set_or_return( :path, arg, - :kind_of => String + :kind_of => String, ) end diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb index 6ffa0ca248..fabe438555 100644 --- a/lib/chef/resource/dsc_resource.rb +++ b/lib/chef/resource/dsc_resource.rb @@ -103,7 +103,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end private diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb index c3602fa60e..944c54ea22 100644 --- a/lib/chef/resource/dsc_script.rb +++ b/lib/chef/resource/dsc_script.rb @@ -43,7 +43,7 @@ class Chef set_or_return( :code, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -54,7 +54,7 @@ class Chef set_or_return( :configuration_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -76,7 +76,7 @@ class Chef set_or_return( :configuration_data, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -87,7 +87,7 @@ class Chef set_or_return( :configuration_data_script, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -108,7 +108,7 @@ class Chef set_or_return( :flags, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -116,7 +116,7 @@ class Chef set_or_return( :cwd, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -124,7 +124,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -132,7 +132,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end end diff --git a/lib/chef/resource/env.rb b/lib/chef/resource/env.rb index 025bfc72b7..32c12dba09 100644 --- a/lib/chef/resource/env.rb +++ b/lib/chef/resource/env.rb @@ -41,7 +41,7 @@ class Chef set_or_return( :key_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -49,7 +49,7 @@ class Chef set_or_return( :value, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -57,7 +57,7 @@ class Chef set_or_return( :delim, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end end diff --git a/lib/chef/resource/erl_call.rb b/lib/chef/resource/erl_call.rb index 1976c54c45..b991fac017 100644 --- a/lib/chef/resource/erl_call.rb +++ b/lib/chef/resource/erl_call.rb @@ -44,7 +44,7 @@ class Chef set_or_return( :code, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -52,7 +52,7 @@ class Chef set_or_return( :cookie, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -60,7 +60,7 @@ class Chef set_or_return( :distributed, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -68,7 +68,7 @@ class Chef set_or_return( :name_type, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -76,7 +76,7 @@ class Chef set_or_return( :node_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb index 4f92a7ad35..19138469f8 100644 --- a/lib/chef/resource/execute.rb +++ b/lib/chef/resource/execute.rb @@ -56,7 +56,7 @@ class Chef set_or_return( :umask, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -64,7 +64,7 @@ class Chef set_or_return( :command, arg, - :kind_of => [ String, Array ] + :kind_of => [ String, Array ], ) end @@ -72,7 +72,7 @@ class Chef set_or_return( :creates, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -80,7 +80,7 @@ class Chef set_or_return( :cwd, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -88,7 +88,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -98,7 +98,7 @@ class Chef set_or_return( :group, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -115,7 +115,7 @@ class Chef set_or_return( :path, arg, - :kind_of => [ Array ] + :kind_of => [ Array ], ) end @@ -123,7 +123,7 @@ class Chef set_or_return( :returns, arg, - :kind_of => [ Integer, Array ] + :kind_of => [ Integer, Array ], ) end @@ -131,7 +131,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => [ Integer, Float ] + :kind_of => [ Integer, Float ], ) end @@ -139,7 +139,7 @@ class Chef set_or_return( :user, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -164,7 +164,7 @@ class Chef :environment, :group, :user, - :umask + :umask, ) end diff --git a/lib/chef/resource/git.rb b/lib/chef/resource/git.rb index 393a0689fe..62c7bc2600 100644 --- a/lib/chef/resource/git.rb +++ b/lib/chef/resource/git.rb @@ -31,7 +31,7 @@ class Chef set_or_return( :additional_remotes, arg, - :kind_of => Hash + :kind_of => Hash, ) end diff --git a/lib/chef/resource/group.rb b/lib/chef/resource/group.rb index 2e80f32fea..2f829a4b44 100644 --- a/lib/chef/resource/group.rb +++ b/lib/chef/resource/group.rb @@ -42,7 +42,7 @@ class Chef set_or_return( :group_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -50,7 +50,7 @@ class Chef set_or_return( :gid, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -59,7 +59,7 @@ class Chef set_or_return( :members, converted_members, - :kind_of => [ Array ] + :kind_of => [ Array ], ) end @@ -70,7 +70,7 @@ class Chef set_or_return( :excluded_members, converted_members, - :kind_of => [ Array ] + :kind_of => [ Array ], ) end @@ -79,7 +79,7 @@ class Chef set_or_return( :append, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -87,7 +87,7 @@ class Chef set_or_return( :system, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -95,7 +95,7 @@ class Chef set_or_return( :non_unique, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end end diff --git a/lib/chef/resource/http_request.rb b/lib/chef/resource/http_request.rb index f9f056325a..73ab64b62e 100644 --- a/lib/chef/resource/http_request.rb +++ b/lib/chef/resource/http_request.rb @@ -40,7 +40,7 @@ class Chef set_or_return( :url, args, - :kind_of => String + :kind_of => String, ) end @@ -49,7 +49,7 @@ class Chef set_or_return( :message, args, - :kind_of => Object + :kind_of => Object, ) end @@ -57,7 +57,7 @@ class Chef set_or_return( :headers, args, - :kind_of => Hash + :kind_of => Hash, ) end diff --git a/lib/chef/resource/ifconfig.rb b/lib/chef/resource/ifconfig.rb index 527eb0e515..0587c760b4 100644 --- a/lib/chef/resource/ifconfig.rb +++ b/lib/chef/resource/ifconfig.rb @@ -50,7 +50,7 @@ class Chef set_or_return( :target, arg, - :kind_of => String + :kind_of => String, ) end @@ -58,7 +58,7 @@ class Chef set_or_return( :device, arg, - :kind_of => String + :kind_of => String, ) end @@ -66,7 +66,7 @@ class Chef set_or_return( :hwaddr, arg, - :kind_of => String + :kind_of => String, ) end @@ -74,7 +74,7 @@ class Chef set_or_return( :inet_addr, arg, - :kind_of => String + :kind_of => String, ) end @@ -82,7 +82,7 @@ class Chef set_or_return( :bcast, arg, - :kind_of => String + :kind_of => String, ) end @@ -90,7 +90,7 @@ class Chef set_or_return( :mask, arg, - :kind_of => String + :kind_of => String, ) end @@ -98,7 +98,7 @@ class Chef set_or_return( :mtu, arg, - :kind_of => String + :kind_of => String, ) end @@ -106,7 +106,7 @@ class Chef set_or_return( :metric, arg, - :kind_of => String + :kind_of => String, ) end @@ -114,7 +114,7 @@ class Chef set_or_return( :onboot, arg, - :kind_of => String + :kind_of => String, ) end @@ -122,7 +122,7 @@ class Chef set_or_return( :network, arg, - :kind_of => String + :kind_of => String, ) end @@ -130,7 +130,7 @@ class Chef set_or_return( :bootproto, arg, - :kind_of => String + :kind_of => String, ) end @@ -138,7 +138,7 @@ class Chef set_or_return( :onparent, arg, - :kind_of => String + :kind_of => String, ) end end diff --git a/lib/chef/resource/link.rb b/lib/chef/resource/link.rb index f932383cc1..de8619203a 100644 --- a/lib/chef/resource/link.rb +++ b/lib/chef/resource/link.rb @@ -44,7 +44,7 @@ class Chef set_or_return( :to, arg, - :kind_of => String + :kind_of => String, ) end @@ -52,7 +52,7 @@ class Chef set_or_return( :target_file, arg, - :kind_of => String + :kind_of => String, ) end @@ -61,7 +61,7 @@ class Chef set_or_return( :link_type, real_arg, - :equal_to => [ :symbolic, :hard ] + :equal_to => [ :symbolic, :hard ], ) end @@ -69,7 +69,7 @@ class Chef set_or_return( :group, arg, - :regex => Chef::Config[:group_valid_regex] + :regex => Chef::Config[:group_valid_regex], ) end @@ -77,7 +77,7 @@ class Chef set_or_return( :owner, arg, - :regex => Chef::Config[:user_valid_regex] + :regex => Chef::Config[:user_valid_regex], ) end diff --git a/lib/chef/resource/log.rb b/lib/chef/resource/log.rb index 9adffb26bb..206bbf4867 100644 --- a/lib/chef/resource/log.rb +++ b/lib/chef/resource/log.rb @@ -58,7 +58,7 @@ class Chef set_or_return( :message, arg, - :kind_of => String + :kind_of => String, ) end @@ -67,7 +67,7 @@ class Chef set_or_return( :level, arg, - :equal_to => [ :debug, :info, :warn, :error, :fatal ] + :equal_to => [ :debug, :info, :warn, :error, :fatal ], ) end diff --git a/lib/chef/resource/macosx_service.rb b/lib/chef/resource/macosx_service.rb index f1ed4051cb..e581b8746d 100644 --- a/lib/chef/resource/macosx_service.rb +++ b/lib/chef/resource/macosx_service.rb @@ -41,7 +41,7 @@ class Chef set_or_return( :plist, arg, - :kind_of => String + :kind_of => String, ) end @@ -49,7 +49,7 @@ class Chef set_or_return( :session_type, arg, - :kind_of => String + :kind_of => String, ) end diff --git a/lib/chef/resource/mdadm.rb b/lib/chef/resource/mdadm.rb index b789fab155..93430a656f 100644 --- a/lib/chef/resource/mdadm.rb +++ b/lib/chef/resource/mdadm.rb @@ -46,7 +46,7 @@ class Chef set_or_return( :chunk, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end @@ -54,7 +54,7 @@ class Chef set_or_return( :devices, arg, - :kind_of => [ Array ] + :kind_of => [ Array ], ) end @@ -62,7 +62,7 @@ class Chef set_or_return( :exists, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -70,7 +70,7 @@ class Chef set_or_return( :level, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end @@ -78,7 +78,7 @@ class Chef set_or_return( :metadata, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -86,7 +86,7 @@ class Chef set_or_return( :bitmap, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -94,7 +94,7 @@ class Chef set_or_return( :raid_device, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb index a5da0ba329..eefa03a506 100644 --- a/lib/chef/resource/mount.rb +++ b/lib/chef/resource/mount.rb @@ -52,7 +52,7 @@ class Chef set_or_return( :mount_point, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -60,7 +60,7 @@ class Chef set_or_return( :device, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -74,7 +74,7 @@ class Chef set_or_return( :device_type, real_arg, - :equal_to => valid_devices + :equal_to => valid_devices, ) end @@ -82,7 +82,7 @@ class Chef set_or_return( :fsck_device, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -90,7 +90,7 @@ class Chef set_or_return( :fstype, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -98,7 +98,7 @@ class Chef ret = set_or_return( :options, arg, - :kind_of => [ Array, String ] + :kind_of => [ Array, String ], ) if ret.is_a? String @@ -112,7 +112,7 @@ class Chef set_or_return( :dump, arg, - :kind_of => [ Integer, FalseClass ] + :kind_of => [ Integer, FalseClass ], ) end @@ -120,7 +120,7 @@ class Chef set_or_return( :pass, arg, - :kind_of => [ Integer, FalseClass ] + :kind_of => [ Integer, FalseClass ], ) end @@ -128,7 +128,7 @@ class Chef set_or_return( :mounted, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -136,7 +136,7 @@ class Chef set_or_return( :enabled, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -154,7 +154,7 @@ class Chef set_or_return( :username, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -162,7 +162,7 @@ class Chef set_or_return( :password, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -170,7 +170,7 @@ class Chef set_or_return( :domain, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/ohai.rb b/lib/chef/resource/ohai.rb index 9425e55c0c..8be334fea9 100644 --- a/lib/chef/resource/ohai.rb +++ b/lib/chef/resource/ohai.rb @@ -37,7 +37,7 @@ class Chef set_or_return( :plugin, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -45,7 +45,7 @@ class Chef set_or_return( :name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end end diff --git a/lib/chef/resource/osx_profile.rb b/lib/chef/resource/osx_profile.rb index 26b834a9c0..837ab5400b 100644 --- a/lib/chef/resource/osx_profile.rb +++ b/lib/chef/resource/osx_profile.rb @@ -41,7 +41,7 @@ class Chef set_or_return( :profile_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -49,7 +49,7 @@ class Chef set_or_return( :profile, arg, - :kind_of => [ String, Hash ] + :kind_of => [ String, Hash ], ) end @@ -57,7 +57,7 @@ class Chef set_or_return( :identifier, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :path, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb index 7d432883e4..1f1171390e 100644 --- a/lib/chef/resource/powershell_script.rb +++ b/lib/chef/resource/powershell_script.rb @@ -31,7 +31,7 @@ class Chef set_or_return( :convert_boolean_return, arg, - :kind_of => [ FalseClass, TrueClass ] + :kind_of => [ FalseClass, TrueClass ], ) end diff --git a/lib/chef/resource/registry_key.rb b/lib/chef/resource/registry_key.rb index f1bf7954ce..2faa5243fb 100644 --- a/lib/chef/resource/registry_key.rb +++ b/lib/chef/resource/registry_key.rb @@ -71,7 +71,7 @@ class Chef set_or_return( :key, arg, - :kind_of => String + :kind_of => String, ) end @@ -105,7 +105,7 @@ class Chef set_or_return( :recursive, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -113,7 +113,7 @@ class Chef set_or_return( :architecture, arg, - :kind_of => Symbol + :kind_of => Symbol, ) end diff --git a/lib/chef/resource/remote_directory.rb b/lib/chef/resource/remote_directory.rb index b731f7b201..56473c6420 100644 --- a/lib/chef/resource/remote_directory.rb +++ b/lib/chef/resource/remote_directory.rb @@ -58,7 +58,7 @@ class Chef set_or_return( :source, args, - :kind_of => String + :kind_of => String, ) end @@ -66,7 +66,7 @@ class Chef set_or_return( :files_backup, arg, - :kind_of => [ Integer, FalseClass ] + :kind_of => [ Integer, FalseClass ], ) end @@ -74,7 +74,7 @@ class Chef set_or_return( :purge, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -82,7 +82,7 @@ class Chef set_or_return( :files_group, arg, - :regex => Chef::Config[:group_valid_regex] + :regex => Chef::Config[:group_valid_regex], ) end @@ -90,7 +90,7 @@ class Chef set_or_return( :files_mode, arg, - :regex => /^\d{3,4}$/ + :regex => /^\d{3,4}$/, ) end @@ -98,7 +98,7 @@ class Chef set_or_return( :files_owner, arg, - :regex => Chef::Config[:user_valid_regex] + :regex => Chef::Config[:user_valid_regex], ) end @@ -106,7 +106,7 @@ class Chef set_or_return( :overwrite, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -114,7 +114,7 @@ class Chef set_or_return( :cookbook, args, - :kind_of => String + :kind_of => String, ) end diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb index b7a553cbe8..bd0aa5ced7 100644 --- a/lib/chef/resource/remote_file.rb +++ b/lib/chef/resource/remote_file.rb @@ -76,7 +76,7 @@ class Chef set_or_return( :checksum, args, - :kind_of => String + :kind_of => String, ) end @@ -92,7 +92,7 @@ class Chef set_or_return( :use_etag, args, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -102,7 +102,7 @@ class Chef set_or_return( :use_last_modified, args, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -110,7 +110,7 @@ class Chef set_or_return( :ftp_active_mode, args, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -118,7 +118,7 @@ class Chef set_or_return( :headers, args, - :kind_of => Hash + :kind_of => Hash, ) end diff --git a/lib/chef/resource/route.rb b/lib/chef/resource/route.rb index 3ba8f6215b..a8c9ebd8fe 100644 --- a/lib/chef/resource/route.rb +++ b/lib/chef/resource/route.rb @@ -48,7 +48,7 @@ class Chef set_or_return( :networking, arg, - :kind_of => String + :kind_of => String, ) end @@ -56,7 +56,7 @@ class Chef set_or_return( :networking_ipv6, arg, - :kind_of => String + :kind_of => String, ) end @@ -64,7 +64,7 @@ class Chef set_or_return( :hostname, arg, - :kind_of => String + :kind_of => String, ) end @@ -72,7 +72,7 @@ class Chef set_or_return( :domainname, arg, - :kind_of => String + :kind_of => String, ) end @@ -80,7 +80,7 @@ class Chef set_or_return( :domain, arg, - :kind_of => String + :kind_of => String, ) end @@ -88,7 +88,7 @@ class Chef set_or_return( :target, arg, - :kind_of => String + :kind_of => String, ) end @@ -96,7 +96,7 @@ class Chef set_or_return( :netmask, arg, - :kind_of => String + :kind_of => String, ) end @@ -104,7 +104,7 @@ class Chef set_or_return( :gateway, arg, - :kind_of => String + :kind_of => String, ) end @@ -112,7 +112,7 @@ class Chef set_or_return( :metric, arg, - :kind_of => Integer + :kind_of => Integer, ) end @@ -120,7 +120,7 @@ class Chef set_or_return( :device, arg, - :kind_of => String + :kind_of => String, ) end @@ -129,7 +129,7 @@ class Chef set_or_return( :route_type, real_arg, - :equal_to => [ :host, :net ] + :equal_to => [ :host, :net ], ) end end diff --git a/lib/chef/resource/ruby_block.rb b/lib/chef/resource/ruby_block.rb index ae8e4cb7cd..f529289b1b 100644 --- a/lib/chef/resource/ruby_block.rb +++ b/lib/chef/resource/ruby_block.rb @@ -45,7 +45,7 @@ class Chef set_or_return( :block_name, arg, - :kind_of => String + :kind_of => String, ) end end diff --git a/lib/chef/resource/scm.rb b/lib/chef/resource/scm.rb index 85028c266b..b81a3bfb24 100644 --- a/lib/chef/resource/scm.rb +++ b/lib/chef/resource/scm.rb @@ -46,7 +46,7 @@ class Chef set_or_return( :destination, arg, - :kind_of => String + :kind_of => String, ) end @@ -54,7 +54,7 @@ class Chef set_or_return( :repository, arg, - :kind_of => String + :kind_of => String, ) end @@ -62,7 +62,7 @@ class Chef set_or_return( :revision, arg, - :kind_of => String + :kind_of => String, ) end @@ -70,7 +70,7 @@ class Chef set_or_return( :user, arg, - :kind_of => [String, Integer] + :kind_of => [String, Integer], ) end @@ -78,7 +78,7 @@ class Chef set_or_return( :group, arg, - :kind_of => [String, Integer] + :kind_of => [String, Integer], ) end @@ -86,7 +86,7 @@ class Chef set_or_return( :svn_username, arg, - :kind_of => String + :kind_of => String, ) end @@ -94,7 +94,7 @@ class Chef set_or_return( :svn_password, arg, - :kind_of => String + :kind_of => String, ) end @@ -103,7 +103,7 @@ class Chef set_or_return( :svn_arguments, arg, - :kind_of => String + :kind_of => String, ) end @@ -120,7 +120,7 @@ class Chef set_or_return( :depth, arg, - :kind_of => Integer + :kind_of => Integer, ) end @@ -128,7 +128,7 @@ class Chef set_or_return( :enable_submodules, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -136,7 +136,7 @@ class Chef set_or_return( :enable_checkout, arg, - :kind_of => [TrueClass, FalseClass] + :kind_of => [TrueClass, FalseClass], ) end @@ -144,7 +144,7 @@ class Chef set_or_return( :remote, arg, - :kind_of => String + :kind_of => String, ) end @@ -152,7 +152,7 @@ class Chef set_or_return( :ssh_wrapper, arg, - :kind_of => String + :kind_of => String, ) end @@ -160,7 +160,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => Integer + :kind_of => Integer, ) end @@ -168,7 +168,7 @@ class Chef set_or_return( :checkout_branch, arg, - :kind_of => String + :kind_of => String, ) end @@ -176,7 +176,7 @@ class Chef set_or_return( :environment, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb index 5081adf918..1579b06eba 100644 --- a/lib/chef/resource/script.rb +++ b/lib/chef/resource/script.rb @@ -49,7 +49,7 @@ class Chef set_or_return( :code, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -57,7 +57,7 @@ class Chef set_or_return( :interpreter, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :flags, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb index 6d1b81f9cb..809eb5f2cb 100644 --- a/lib/chef/resource/service.rb +++ b/lib/chef/resource/service.rb @@ -52,7 +52,7 @@ class Chef set_or_return( :service_name, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -61,7 +61,7 @@ class Chef set_or_return( :pattern, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -70,7 +70,7 @@ class Chef set_or_return( :start_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -79,7 +79,7 @@ class Chef set_or_return( :stop_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -88,7 +88,7 @@ class Chef set_or_return( :status_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -97,7 +97,7 @@ class Chef set_or_return( :restart_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -105,7 +105,7 @@ class Chef set_or_return( :reload_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -118,7 +118,7 @@ class Chef set_or_return( :init_command, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -127,7 +127,7 @@ class Chef set_or_return( :enabled, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -136,7 +136,7 @@ class Chef set_or_return( :running, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -154,7 +154,7 @@ class Chef set_or_return( :priority, arg, - :kind_of => [ Integer, String, Hash ] + :kind_of => [ Integer, String, Hash ], ) end @@ -163,7 +163,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => Integer + :kind_of => Integer, ) end @@ -171,7 +171,7 @@ class Chef set_or_return( :parameters, arg, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb index 5a7f7efd6f..1d8d690c1a 100644 --- a/lib/chef/resource/template.rb +++ b/lib/chef/resource/template.rb @@ -45,7 +45,7 @@ class Chef set_or_return( :source, file, - :kind_of => [ String, Array ] + :kind_of => [ String, Array ], ) end @@ -53,7 +53,7 @@ class Chef set_or_return( :variables, args, - :kind_of => [ Hash ] + :kind_of => [ Hash ], ) end @@ -61,7 +61,7 @@ class Chef set_or_return( :cookbook, args, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -69,7 +69,7 @@ class Chef set_or_return( :local, args, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb index b85b648c92..f9c272170c 100644 --- a/lib/chef/resource/user.rb +++ b/lib/chef/resource/user.rb @@ -43,7 +43,7 @@ class Chef @non_unique = false @supports = { :manage_home => false, - :non_unique => false + :non_unique => false, } @iterations = 27855 @salt = nil @@ -53,7 +53,7 @@ class Chef set_or_return( :username, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -61,7 +61,7 @@ class Chef set_or_return( :comment, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -69,7 +69,7 @@ class Chef set_or_return( :uid, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -77,7 +77,7 @@ class Chef set_or_return( :gid, arg, - :kind_of => [ String, Integer ] + :kind_of => [ String, Integer ], ) end @@ -87,7 +87,7 @@ class Chef set_or_return( :home, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -95,7 +95,7 @@ class Chef set_or_return( :shell, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -103,7 +103,7 @@ class Chef set_or_return( :password, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -111,7 +111,7 @@ class Chef set_or_return( :salt, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -119,7 +119,7 @@ class Chef set_or_return( :iterations, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer ], ) end @@ -127,7 +127,7 @@ class Chef set_or_return( :system, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -135,7 +135,7 @@ class Chef set_or_return( :manage_home, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -143,7 +143,7 @@ class Chef set_or_return( :force, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end @@ -151,7 +151,7 @@ class Chef set_or_return( :non_unique, arg, - :kind_of => [ TrueClass, FalseClass ] + :kind_of => [ TrueClass, FalseClass ], ) end diff --git a/lib/chef/resource/windows_script.rb b/lib/chef/resource/windows_script.rb index 2dff4cde31..8fb9ef9e0d 100644 --- a/lib/chef/resource/windows_script.rb +++ b/lib/chef/resource/windows_script.rb @@ -45,7 +45,7 @@ class Chef result = set_or_return( :architecture, arg, - :kind_of => Symbol + :kind_of => Symbol, ) end diff --git a/lib/chef/resource/windows_service.rb b/lib/chef/resource/windows_service.rb index a77690652e..f7ec02a294 100644 --- a/lib/chef/resource/windows_service.rb +++ b/lib/chef/resource/windows_service.rb @@ -47,7 +47,7 @@ class Chef set_or_return( :startup_type, arg, - :equal_to => [ :automatic, :manual, :disabled ] + :equal_to => [ :automatic, :manual, :disabled ], ) end @@ -55,7 +55,7 @@ class Chef set_or_return( :run_as_user, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end @@ -63,7 +63,7 @@ class Chef set_or_return( :run_as_password, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end end diff --git a/lib/chef/resource_collection/resource_collection_serialization.rb b/lib/chef/resource_collection/resource_collection_serialization.rb index 3651fb2a2a..738671e20b 100644 --- a/lib/chef/resource_collection/resource_collection_serialization.rb +++ b/lib/chef/resource_collection/resource_collection_serialization.rb @@ -26,7 +26,7 @@ class Chef end { 'json_class' => self.class.name, - 'instance_vars' => instance_vars + 'instance_vars' => instance_vars, } end diff --git a/lib/chef/role.rb b/lib/chef/role.rb index 6984a8a245..d1854ed44d 100644 --- a/lib/chef/role.rb +++ b/lib/chef/role.rb @@ -57,7 +57,7 @@ class Chef set_or_return( :name, arg, - :regex => /^[\-[:alnum:]_]+$/ + :regex => /^[\-[:alnum:]_]+$/, ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :description, arg, - :kind_of => String + :kind_of => String, ) end @@ -121,7 +121,7 @@ class Chef set_or_return( :default_attributes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -129,7 +129,7 @@ class Chef set_or_return( :override_attributes, arg, - :kind_of => Hash + :kind_of => Hash, ) end @@ -150,7 +150,7 @@ class Chef "env_run_lists" => env_run_lists_without_default.inject({}) do |accumulator, (k, v)| accumulator[k] = v.map { |x| x.to_s } accumulator - end + end, } result end diff --git a/lib/chef/user.rb b/lib/chef/user.rb index 1bcef448ff..0944bc05c8 100644 --- a/lib/chef/user.rb +++ b/lib/chef/user.rb @@ -81,7 +81,7 @@ class Chef result = { "name" => @name, "public_key" => @public_key, - "admin" => @admin + "admin" => @admin, } result["private_key"] = @private_key if @private_key result["password"] = @password if @password diff --git a/lib/chef/user_v1.rb b/lib/chef/user_v1.rb index 1bded3500f..033c71548c 100644 --- a/lib/chef/user_v1.rb +++ b/lib/chef/user_v1.rb @@ -146,7 +146,7 @@ class Chef :first_name => @first_name, :last_name => @last_name, :email => @email, - :password => @password + :password => @password, } payload[:public_key] = @public_key unless @public_key.nil? payload[:create_key] = @create_key unless @create_key.nil? @@ -172,7 +172,7 @@ class Chef :first_name => @first_name, :last_name => @last_name, :email => @email, - :password => @password + :password => @password, } payload[:middle_name] = @middle_name unless @middle_name.nil? payload[:public_key] = @public_key unless @public_key.nil? diff --git a/lib/chef/win32/api/crypto.rb b/lib/chef/win32/api/crypto.rb index 1837a57557..cf32287a17 100644 --- a/lib/chef/win32/api/crypto.rb +++ b/lib/chef/win32/api/crypto.rb @@ -1,63 +1,63 @@ -#
-# Author:: Jay Mundrawala (<jdm@chef.io>)
-# Copyright:: Copyright 2015 Chef Software, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require 'chef/win32/api'
-
-class Chef
- module ReservedNames::Win32
- module API
- module Crypto
- extend Chef::ReservedNames::Win32::API
-
- ###############################################
- # Win32 API Bindings
- ###############################################
-
- ffi_lib 'Crypt32'
-
- CRYPTPROTECT_UI_FORBIDDEN = 0x1
- CRYPTPROTECT_LOCAL_MACHINE = 0x4
- CRYPTPROTECT_AUDIT = 0x10
-
- class CRYPT_INTEGER_BLOB < FFI::Struct
- layout :cbData, :DWORD, # Count, in bytes, of data
- :pbData, :pointer # Pointer to data buffer
- def initialize(str=nil)
- super(nil)
- if str
- self[:pbData] = FFI::MemoryPointer.from_string(str)
- self[:cbData] = str.bytesize
- end
- end
-
- end
-
- safe_attach_function :CryptProtectData, [
- :PDATA_BLOB,
- :LPCWSTR,
- :PDATA_BLOB,
- :pointer,
- :PCRYPTPROTECT_PROMPTSTRUCT,
- :DWORD,
- :PDATA_BLOB
- ], :BOOL
-
- end
- end
- end
-end
+# +# Author:: Jay Mundrawala (<jdm@chef.io>) +# Copyright:: Copyright 2015 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/win32/api' + +class Chef + module ReservedNames::Win32 + module API + module Crypto + extend Chef::ReservedNames::Win32::API + + ############################################### + # Win32 API Bindings + ############################################### + + ffi_lib 'Crypt32' + + CRYPTPROTECT_UI_FORBIDDEN = 0x1 + CRYPTPROTECT_LOCAL_MACHINE = 0x4 + CRYPTPROTECT_AUDIT = 0x10 + + class CRYPT_INTEGER_BLOB < FFI::Struct + layout :cbData, :DWORD, # Count, in bytes, of data + :pbData, :pointer # Pointer to data buffer + def initialize(str=nil) + super(nil) + if str + self[:pbData] = FFI::MemoryPointer.from_string(str) + self[:cbData] = str.bytesize + end + end + + end + + safe_attach_function :CryptProtectData, [ + :PDATA_BLOB, + :LPCWSTR, + :PDATA_BLOB, + :pointer, + :PCRYPTPROTECT_PROMPTSTRUCT, + :DWORD, + :PDATA_BLOB, + ], :BOOL + + end + end + end +end diff --git a/lib/chef/win32/api/security.rb b/lib/chef/win32/api/security.rb index 4353c488f8..06fdf650f4 100644 --- a/lib/chef/win32/api/security.rb +++ b/lib/chef/win32/api/security.rb @@ -239,7 +239,7 @@ class Chef :SE_DS_OBJECT_ALL, :SE_PROVIDER_DEFINED_OBJECT, :SE_WMIGUID_OBJECT, - :SE_REGISTRY_WOW64_32KEY + :SE_REGISTRY_WOW64_32KEY, ] SID_NAME_USE = enum :SID_NAME_USE, [ @@ -312,7 +312,7 @@ class Chef :SecurityAnonymous, :SecurityIdentification, :SecurityImpersonation, - :SecurityDelegation + :SecurityDelegation, ] @@ -351,7 +351,7 @@ class Chef ACCESS_ALLOWED_ACE_TYPE, ACCESS_DENIED_ACE_TYPE, SYSTEM_AUDIT_ACE_TYPE, - SYSTEM_ALARM_ACE_TYPE + SYSTEM_ALARM_ACE_TYPE, ].include?(ace_type) end end diff --git a/lib/chef/win32/file/version_info.rb b/lib/chef/win32/file/version_info.rb index 2974c8a695..30e9604ad1 100644 --- a/lib/chef/win32/file/version_info.rb +++ b/lib/chef/win32/file/version_info.rb @@ -45,7 +45,7 @@ class Chef :ProductName, :ProductVersion, :PrivateBuild, - :SpecialBuild + :SpecialBuild, ].each do |method| define_method method do begin diff --git a/lib/chef/win32/net.rb b/lib/chef/win32/net.rb index c0cf564621..9e4f90b1b7 100644 --- a/lib/chef/win32/net.rb +++ b/lib/chef/win32/net.rb @@ -62,7 +62,7 @@ class Chef usri3_primary_group_id: DOMAIN_GROUP_RID_USERS, usri3_profile: nil, usri3_home_dir_drive: nil, - usri3_password_expired: 0 + usri3_password_expired: 0, }.each do |(k,v)| s.set(k, v) end diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb index 3c1f62d9b8..af8de59d0f 100644 --- a/lib/chef/win32/registry.rb +++ b/lib/chef/win32/registry.rb @@ -326,7 +326,7 @@ class Chef :expand_string => ::Win32::Registry::REG_EXPAND_SZ, :dword => ::Win32::Registry::REG_DWORD, :dword_big_endian => ::Win32::Registry::REG_DWORD_BIG_ENDIAN, - :qword => ::Win32::Registry::REG_QWORD + :qword => ::Win32::Registry::REG_QWORD, } end @@ -342,7 +342,7 @@ class Chef 2 => ::Win32::Registry::REG_EXPAND_SZ, 4 => ::Win32::Registry::REG_DWORD, 5 => ::Win32::Registry::REG_DWORD_BIG_ENDIAN, - 11 => ::Win32::Registry::REG_QWORD + 11 => ::Win32::Registry::REG_QWORD, }[val_type] return value end diff --git a/lib/chef/win32/version.rb b/lib/chef/win32/version.rb index 6a7a65b01b..ca715dd604 100644 --- a/lib/chef/win32/version.rb +++ b/lib/chef/win32/version.rb @@ -62,7 +62,7 @@ class Chef "Windows Home Server" => {:major => 5, :minor => 2, :callable => lambda{ |product_type, suite_mask| (suite_mask & VER_SUITE_WH_SERVER) == VER_SUITE_WH_SERVER }}, "Windows Server 2003" => {:major => 5, :minor => 2, :callable => lambda{ |product_type, suite_mask| get_system_metrics(SM_SERVERR2) == 0 }}, "Windows XP" => {:major => 5, :minor => 1}, - "Windows 2000" => {:major => 5, :minor => 0} + "Windows 2000" => {:major => 5, :minor => 0}, } def initialize |