diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:31:50 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:31:50 -0700 |
commit | cdad2f684debda15e8cf773185e78f93892eda35 (patch) | |
tree | 24d815246b9130d040608b15a5a36d942e538587 | |
parent | 34a6dd714503abbb0e6d240a4832f245d5c3ab06 (diff) | |
download | chef-cdad2f684debda15e8cf773185e78f93892eda35.tar.gz |
fix Layout/LeadingCommentSpace
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
88 files changed, 289 insertions, 289 deletions
diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index 13af4dd12b..a1a0b32893 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -13,11 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # NOTE: This file is generated by running `rake version` in the top level of # this repo. Do not edit this manually. Edit the VERSION file and run the rake # task instead. -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! module ChefConfig CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__) diff --git a/lib/chef/cookbook/synchronizer.rb b/lib/chef/cookbook/synchronizer.rb index 6df39fece3..6955abd6d7 100644 --- a/lib/chef/cookbook/synchronizer.rb +++ b/lib/chef/cookbook/synchronizer.rb @@ -143,7 +143,7 @@ class Chef end # Synchronizes all the cookbooks from the chef-server. - #) + # ) # === Returns # true:: Always returns true def sync_cookbooks diff --git a/lib/chef/data_bag.rb b/lib/chef/data_bag.rb index 1e23cdfb1c..9a71d89abb 100644 --- a/lib/chef/data_bag.rb +++ b/lib/chef/data_bag.rb @@ -157,7 +157,7 @@ class Chef self end - #create a data bag via RESTful API + # create a data bag via RESTful API def create chef_server_rest.post("data", self) self diff --git a/lib/chef/event_loggers/windows_eventlog.rb b/lib/chef/event_loggers/windows_eventlog.rb index a9473ed1f6..860d049314 100644 --- a/lib/chef/event_loggers/windows_eventlog.rb +++ b/lib/chef/event_loggers/windows_eventlog.rb @@ -73,10 +73,10 @@ class Chef ) end - #Failed chef-client run %1 in %2 seconds. - #Exception type: %3 - #Exception message: %4 - #Exception backtrace: %5 + # Failed chef-client run %1 in %2 seconds. + # Exception type: %3 + # Exception message: %4 + # Exception backtrace: %5 def run_failed(e) data = if @run_status diff --git a/lib/chef/formatters/base.rb b/lib/chef/formatters/base.rb index 997577aa7b..fa309b67e7 100644 --- a/lib/chef/formatters/base.rb +++ b/lib/chef/formatters/base.rb @@ -96,7 +96,7 @@ class Chef if @output.indent < 0 # This is left commented out for now. We need to uncomment it and fix at least one bug in # the formatter, and then leave this line uncommented in the future. - #Chef::Log.warn "Internal Formatter Error -- Attempt to indent by negative number of spaces" + # Chef::Log.warn "Internal Formatter Error -- Attempt to indent by negative number of spaces" @output.indent = 0 end @output.indent @@ -110,7 +110,7 @@ class Chef end def registration_failed(node_name, exception, config) - #A Formatters::ErrorDescription object + # A Formatters::ErrorDescription object description = ErrorMapper.registration_failed(node_name, exception, config) display_error(description) end diff --git a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb index b912800bc5..02e8b0d61a 100644 --- a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb @@ -114,13 +114,13 @@ E end def username - #config[:node_name] + # config[:node_name] config[:validation_client_name] end def api_key config[:validation_key] - #config[:client_key] + # config[:client_key] end def server_url diff --git a/lib/chef/handler/json_file.rb b/lib/chef/handler/json_file.rb index 7f29b91449..3dc7c51274 100644 --- a/lib/chef/handler/json_file.rb +++ b/lib/chef/handler/json_file.rb @@ -41,7 +41,7 @@ class Chef savetime = Time.now.strftime("%Y%m%d%H%M%S") File.open(File.join(config[:path], "chef-run-report-#{savetime}.json"), "w") do |file| - #ensure start time and end time are output in the json properly in the event activesupport happens to be on the system + # ensure start time and end time are output in the json properly in the event activesupport happens to be on the system run_data = data run_data[:start_time] = run_data[:start_time].to_s run_data[:end_time] = run_data[:end_time].to_s diff --git a/lib/chef/http/http_request.rb b/lib/chef/http/http_request.rb index de589e429e..475043bdb4 100644 --- a/lib/chef/http/http_request.rb +++ b/lib/chef/http/http_request.rb @@ -27,7 +27,7 @@ require "net/http" # However, in ohai before 0.6.0, the version is defined # in ohai, not ohai/version begin - require "ohai/version" #used in user agent string. + require "ohai/version" # used in user agent string. rescue LoadError require "ohai" end diff --git a/lib/chef/key.rb b/lib/chef/key.rb index ef006f8ace..1020d60ac6 100644 --- a/lib/chef/key.rb +++ b/lib/chef/key.rb @@ -140,7 +140,7 @@ class Chef # defaults the key name to the fingerprint of the key if @name.nil? # if they didn't pass a public_key, - #then they must supply a name because we can't generate a fingerprint + # then they must supply a name because we can't generate a fingerprint unless @public_key.nil? @name = fingerprint else diff --git a/lib/chef/knife/cookbook_site_install.rb b/lib/chef/knife/cookbook_site_install.rb index faa8c54c4b..18cddb19f4 100644 --- a/lib/chef/knife/cookbook_site_install.rb +++ b/lib/chef/knife/cookbook_site_install.rb @@ -86,7 +86,7 @@ class Chef ui.info "Installing #{@cookbook_name} to #{@install_path}" @repo = CookbookSCMRepo.new(@install_path, ui, config) - #cookbook_path = File.join(vendor_path, name_args[0]) + # cookbook_path = File.join(vendor_path, name_args[0]) upstream_file = File.join(@install_path, "#{@cookbook_name}.tar.gz") @repo.sanity_check diff --git a/lib/chef/knife/role_env_run_list_remove.rb b/lib/chef/knife/role_env_run_list_remove.rb index 576e32e2a9..f31f40b58a 100644 --- a/lib/chef/knife/role_env_run_list_remove.rb +++ b/lib/chef/knife/role_env_run_list_remove.rb @@ -33,9 +33,9 @@ class Chef nlist = [] role.run_list_for(environment).each do |entry| nlist << entry unless entry == item_to_remove - #unless entry == @name_args[2] + # unless entry == @name_args[2] # nlist << entry - #end + # end end role.env_run_lists_add(environment => nlist) end diff --git a/lib/chef/knife/role_run_list_remove.rb b/lib/chef/knife/role_run_list_remove.rb index 0dacfee051..6fd35c6aaa 100644 --- a/lib/chef/knife/role_run_list_remove.rb +++ b/lib/chef/knife/role_run_list_remove.rb @@ -33,9 +33,9 @@ class Chef nlist = [] role.run_list_for(environment).each do |entry| nlist << entry unless entry == item_to_remove - #unless entry == @name_args[2] + # unless entry == @name_args[2] # nlist << entry - #end + # end end role.env_run_lists_add(environment => nlist) end diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb index 5bdbfd5498..74e457ac8e 100644 --- a/lib/chef/knife/ssh.rb +++ b/lib/chef/knife/ssh.rb @@ -138,7 +138,7 @@ class Chef def session ssh_error_handler = Proc.new do |server| if config[:on_error] - #Net::SSH::Multi magic to force exception to be re-raised. + # Net::SSH::Multi magic to force exception to be re-raised. throw :go, :raise else ui.warn "Failed to connect to #{server.host} -- #{$!.class.name}: #{$!.message}" diff --git a/lib/chef/mixin/windows_env_helper.rb b/lib/chef/mixin/windows_env_helper.rb index 65b4b33cf0..610c0cd075 100644 --- a/lib/chef/mixin/windows_env_helper.rb +++ b/lib/chef/mixin/windows_env_helper.rb @@ -32,7 +32,7 @@ class Chef include Chef::ReservedNames::Win32::API::System end - #see: http://msdn.microsoft.com/en-us/library/ms682653%28VS.85%29.aspx + # see: http://msdn.microsoft.com/en-us/library/ms682653%28VS.85%29.aspx HWND_BROADCAST = 0xffff WM_SETTINGCHANGE = 0x001A SMTO_BLOCK = 0x0001 diff --git a/lib/chef/node.rb b/lib/chef/node.rb index 114a38d8d0..b9a005e419 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -495,7 +495,7 @@ class Chef "chef_type" => "node", "default" => attributes.combined_default, "override" => attributes.combined_override, - #Render correctly for run_list items so malformed json does not result + # Render correctly for run_list items so malformed json does not result "run_list" => @primary_runlist.run_list.map { |item| item.to_s }, } # Chef Server rejects node JSON with extra keys; prior to 12.3, diff --git a/lib/chef/provider/mount/windows.rb b/lib/chef/provider/mount/windows.rb index 0fb9184783..1650d1e43a 100644 --- a/lib/chef/provider/mount/windows.rb +++ b/lib/chef/provider/mount/windows.rb @@ -41,7 +41,7 @@ class Chef def load_current_resource if is_volume(@new_resource.device) @mount = Chef::Util::Windows::Volume.new(@new_resource.mount_point) - else #assume network drive + else # assume network drive @mount = Chef::Util::Windows::NetUse.new(@new_resource.mount_point) end diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb index 0af4f87d7f..01d8829dd2 100644 --- a/lib/chef/provider/package.rb +++ b/lib/chef/provider/package.rb @@ -307,7 +307,7 @@ class Chef # used by subclasses. deprecated. use #a_to_s instead. def expand_options(options) # its deprecated but still work to do to deprecate it fully - #Chef.deprecated(:package_misc, "expand_options is deprecated, use shell_out instead") + # Chef.deprecated(:package_misc, "expand_options is deprecated, use shell_out instead") if options " #{options.is_a?(Array) ? Shellwords.join(options) : options}" else diff --git a/lib/chef/provider/resource_update.rb b/lib/chef/provider/resource_update.rb index e069a8201c..d3c674dd22 100644 --- a/lib/chef/provider/resource_update.rb +++ b/lib/chef/provider/resource_update.rb @@ -31,7 +31,7 @@ class Chef attr_accessor :type attr_accessor :name - attr_accessor :duration #ms + attr_accessor :duration # ms attr_accessor :status attr_accessor :initial_state attr_accessor :final_state diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb index 3e177d744b..2482ce6a5c 100644 --- a/lib/chef/provider/service/windows.rb +++ b/lib/chef/provider/service/windows.rb @@ -33,12 +33,12 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service include Chef::ReservedNames::Win32::API::Error rescue LoadError include Chef::Win32ServiceConstants - #Win32::Service.get_start_type + # Win32::Service.get_start_type AUTO_START = "auto start" MANUAL = "demand start" DISABLED = "disabled" - #Win32::Service.get_current_state + # Win32::Service.get_current_state RUNNING = "running" STOPPED = "stopped" CONTINUE_PENDING = "continue pending" diff --git a/lib/chef/provider/subversion.rb b/lib/chef/provider/subversion.rb index c5c2439d84..dec9e06f87 100644 --- a/lib/chef/provider/subversion.rb +++ b/lib/chef/provider/subversion.rb @@ -16,7 +16,7 @@ # limitations under the License. # -#TODO subversion and git should both extend from a base SCM provider. +# TODO subversion and git should both extend from a base SCM provider. require "chef/log" require "chef/provider" diff --git a/lib/chef/provider/windows_env.rb b/lib/chef/provider/windows_env.rb index 4e7fa34216..e5af49fa8f 100644 --- a/lib/chef/provider/windows_env.rb +++ b/lib/chef/provider/windows_env.rb @@ -63,7 +63,7 @@ class Chef # <false>:: If a change is not required def requires_modify_or_create? if new_resource.delim - #e.g. check for existing value within PATH + # e.g. check for existing value within PATH new_values.inject(0) do |index, val| next_index = current_values.find_index val return true if next_index.nil? || next_index < index @@ -91,18 +91,18 @@ class Chef end end - #e.g. delete a PATH element + # e.g. delete a PATH element # # ==== Returns # <true>:: If we handled the element case and caller should not delete the key # <false>:: Caller should delete the key, either no :delim was specific or value was empty # after we removed the element. def delete_element - return false unless new_resource.delim #no delim: delete the key + return false unless new_resource.delim # no delim: delete the key needs_delete = new_values.any? { |v| current_values.include?(v) } if !needs_delete logger.trace("#{new_resource} element '#{new_resource.value}' does not exist") - return true #do not delete the key + return true # do not delete the key else new_value = current_values.select do |item| @@ -110,13 +110,13 @@ class Chef end.join(new_resource.delim) if new_value.empty? - return false #nothing left here, delete the key + return false # nothing left here, delete the key else old_value = new_resource.value(new_value) create_env logger.trace("#{new_resource} deleted #{old_value} element") new_resource.updated_by_last_action(true) - return true #we removed the element and updated; do not delete the key + return true # we removed the element and updated; do not delete the key end end end diff --git a/lib/chef/provider/windows_task.rb b/lib/chef/provider/windows_task.rb index 1676ec3f6b..af18a3f80d 100644 --- a/lib/chef/provider/windows_task.rb +++ b/lib/chef/provider/windows_task.rb @@ -195,7 +195,7 @@ class Chef logger.trace "#{new_resource} task exists" if current_resource.task.status == "not scheduled" converge_by("#{new_resource} task enabled") do - #TODO wind32-taskscheduler currently not having any method to handle this so using schtasks.exe here + # TODO wind32-taskscheduler currently not having any method to handle this so using schtasks.exe here run_schtasks "CHANGE", "ENABLE" => "" end else @@ -212,7 +212,7 @@ class Chef logger.info "#{new_resource} task exists" if %w{ready running}.include?(current_resource.task.status) converge_by("#{new_resource} task disabled") do - #TODO: in win32-taskscheduler there is no method whcih disbales the task so currently calling disable with schtasks.exe + # TODO: in win32-taskscheduler there is no method whcih disbales the task so currently calling disable with schtasks.exe run_schtasks "CHANGE", "DISABLE" => "" end else @@ -256,7 +256,7 @@ class Chef def trigger start_month, start_day, start_year = new_resource.start_day.to_s.split("/") start_hour, start_minute = new_resource.start_time.to_s.split(":") - #TODO currently end_month, end_year and end_year needs to be set to 0. If not set win32-taskscheduler throwing nil into integer error. + # TODO currently end_month, end_year and end_year needs to be set to 0. If not set win32-taskscheduler throwing nil into integer error. trigger_hash = { start_year: start_year.to_i, start_month: start_month.to_i, @@ -318,7 +318,7 @@ class Chef hours.to_i * 60 if hours end - #TODO : Try to optimize this method + # TODO : Try to optimize this method # known issue : Since start_day and time is not mandatory while updating weekly frequency for which start_day is not mentioned by user idempotency # is not gettting maintained as new_resource.start_day is nil and we fetch the day of week from start_day to set and its currently coming as nil and don't match with current_task def task_needs_update?(task) @@ -452,7 +452,7 @@ class Chef def days_of_week if new_resource.day - #this line of code is just to support backward compatibility of wild card * + # this line of code is just to support backward compatibility of wild card * new_resource.day = "mon, tue, wed, thu, fri, sat, sun" if new_resource.day == "*" && new_resource.frequency == :weekly days = new_resource.day.split(",") days.map! { |day| day.to_s.strip.upcase } @@ -475,7 +475,7 @@ class Chef end if new_resource.months - #this line of code is just to support backward compatibility of wild card * + # this line of code is just to support backward compatibility of wild card * new_resource.months = "jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec" if new_resource.months == "*" && new_resource.frequency == :monthly months = new_resource.months.split(",") months.map! { |month| month.to_s.strip.upcase } @@ -539,7 +539,7 @@ class Chef end end - #TODO: while creating the configuration settings win32-taskscheduler it accepts execution time limit values in ISO8601 formata + # TODO: while creating the configuration settings win32-taskscheduler it accepts execution time limit values in ISO8601 formata def config_settings settings = { execution_time_limit: new_resource.execution_time_limit, diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb index aa1e427bc5..1ec25fc79a 100644 --- a/lib/chef/resource_reporter.rb +++ b/lib/chef/resource_reporter.rb @@ -72,7 +72,7 @@ class Chef as_hash["result"] = action.to_s if success? else - #as_hash["result"] = "failed" + # as_hash["result"] = "failed" end if new_resource.cookbook_name as_hash["cookbook_name"] = new_resource.cookbook_name diff --git a/lib/chef/role.rb b/lib/chef/role.rb index 96aa2185ff..f0c4cdd542 100644 --- a/lib/chef/role.rb +++ b/lib/chef/role.rb @@ -141,8 +141,8 @@ class Chef "override_attributes" => @override_attributes, "chef_type" => "role", - #Render to_json correctly for run_list items (both run_list and evn_run_lists) - #so malformed json does not result + # Render to_json correctly for run_list items (both run_list and evn_run_lists) + # so malformed json does not result "run_list" => run_list.run_list.map { |item| item.to_s }, "env_run_lists" => env_run_lists_without_default.inject({}) do |accumulator, (k, v)| accumulator[k] = v.map { |x| x.to_s } diff --git a/lib/chef/util/backup.rb b/lib/chef/util/backup.rb index a14f006d59..5b6bf0b9b8 100644 --- a/lib/chef/util/backup.rb +++ b/lib/chef/util/backup.rb @@ -52,7 +52,7 @@ class Chef nanoseconds = sprintf("%6f", time.to_f).split(".")[1] savetime = time.strftime("%Y%m%d%H%M%S.#{nanoseconds}") backup_filename = "#{path}.chef-#{savetime}" - backup_filename = backup_filename.sub(/^([A-Za-z]:)/, "") #strip drive letter on Windows + backup_filename = backup_filename.sub(/^([A-Za-z]:)/, "") # strip drive letter on Windows end end diff --git a/lib/chef/util/file_edit.rb b/lib/chef/util/file_edit.rb index 74e2ca6a5f..5a01e72e70 100644 --- a/lib/chef/util/file_edit.rb +++ b/lib/chef/util/file_edit.rb @@ -40,38 +40,38 @@ class Chef @file_edited end - #search the file line by line and match each line with the given regex - #if matched, replace the whole line with newline. + # search the file line by line and match each line with the given regex + # if matched, replace the whole line with newline. def search_file_replace_line(regex, newline) @changes = (editor.replace_lines(regex, newline) > 0) || @changes end - #search the file line by line and match each line with the given regex - #if matched, replace the match (all occurrences) with the replace parameter + # search the file line by line and match each line with the given regex + # if matched, replace the match (all occurrences) with the replace parameter def search_file_replace(regex, replace) @changes = (editor.replace(regex, replace) > 0) || @changes end - #search the file line by line and match each line with the given regex - #if matched, delete the line + # search the file line by line and match each line with the given regex + # if matched, delete the line def search_file_delete_line(regex) @changes = (editor.remove_lines(regex) > 0) || @changes end - #search the file line by line and match each line with the given regex - #if matched, delete the match (all occurrences) from the line + # search the file line by line and match each line with the given regex + # if matched, delete the match (all occurrences) from the line def search_file_delete(regex) search_file_replace(regex, "") end - #search the file line by line and match each line with the given regex - #if matched, insert newline after each matching line + # search the file line by line and match each line with the given regex + # if matched, insert newline after each matching line def insert_line_after_match(regex, newline) @changes = (editor.append_line_after(regex, newline) > 0) || @changes end - #search the file line by line and match each line with the given regex - #if not matched, insert newline at the end of the file + # search the file line by line and match each line with the given regex + # if not matched, insert newline at the end of the file def insert_line_if_no_match(regex, newline) @changes = (editor.append_line_if_missing(regex, newline) > 0) || @changes end @@ -80,7 +80,7 @@ class Chef !!@changes end - #Make a copy of old_file and write new file out (only if file changed) + # Make a copy of old_file and write new file out (only if file changed) def write_file if @changes backup_pathname = original_pathname + ".old" diff --git a/lib/chef/util/windows/net_group.rb b/lib/chef/util/windows/net_group.rb index 214881df56..efe2561bf2 100644 --- a/lib/chef/util/windows/net_group.rb +++ b/lib/chef/util/windows/net_group.rb @@ -19,7 +19,7 @@ require "chef/util/windows" require "chef/win32/net" -#wrapper around a subset of the NetGroup* APIs. +# wrapper around a subset of the NetGroup* APIs. class Chef::Util::Windows::NetGroup private diff --git a/lib/chef/util/windows/net_use.rb b/lib/chef/util/windows/net_use.rb index 196ce42215..99626371a0 100644 --- a/lib/chef/util/windows/net_use.rb +++ b/lib/chef/util/windows/net_use.rb @@ -16,9 +16,9 @@ # limitations under the License. # -#the Win32 Volume APIs do not support mapping network drives. not supported by WMI either. -#see also: WNetAddConnection2 and WNetAddConnection3 -#see also cmd.exe: net use /? +# the Win32 Volume APIs do not support mapping network drives. not supported by WMI either. +# see also: WNetAddConnection2 and WNetAddConnection3 +# see also cmd.exe: net use /? require "chef/util/windows" require "chef/win32/net" diff --git a/lib/chef/util/windows/net_user.rb b/lib/chef/util/windows/net_user.rb index cf8bf3615a..d282ba9046 100644 --- a/lib/chef/util/windows/net_user.rb +++ b/lib/chef/util/windows/net_user.rb @@ -21,8 +21,8 @@ require "chef/exceptions" require "chef/win32/net" require "chef/win32/security" -#wrapper around a subset of the NetUser* APIs. -#nothing Chef specific, but not complete enough to be its own gem, so util for now. +# wrapper around a subset of the NetUser* APIs. +# nothing Chef specific, but not complete enough to be its own gem, so util for now. class Chef::Util::Windows::NetUser < Chef::Util::Windows private @@ -91,7 +91,7 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows LOGON32_PROVIDER_DEFAULT = Security::LOGON32_PROVIDER_DEFAULT LOGON32_LOGON_NETWORK = Security::LOGON32_LOGON_NETWORK - #XXX for an extra painful alternative, see: http://support.microsoft.com/kb/180548 + # XXX for an extra painful alternative, see: http://support.microsoft.com/kb/180548 def validate_credentials(passwd) token = Security.logon_user(@username, nil, passwd, LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT) @@ -118,8 +118,8 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows # FIXME: yard with @yield def user_modify user = get_info - user[:last_logon] = user[:units_per_week] = 0 #ignored as per USER_INFO_3 doc - user[:logon_hours] = nil #PBYTE field; \0 == no changes + user[:last_logon] = user[:units_per_week] = 0 # ignored as per USER_INFO_3 doc + user[:logon_hours] = nil # PBYTE field; \0 == no changes yield(user) set_info(user) end @@ -141,9 +141,9 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows def disable_account user_modify do |user| user[:flags] |= NetUser::UF_ACCOUNTDISABLE - #This does not set the password to nil. It (for some reason) means to ignore updating the field. - #See similar behavior for the logon_hours field documented at - #http://msdn.microsoft.com/en-us/library/windows/desktop/aa371338%28v=vs.85%29.aspx + # This does not set the password to nil. It (for some reason) means to ignore updating the field. + # See similar behavior for the logon_hours field documented at + # http://msdn.microsoft.com/en-us/library/windows/desktop/aa371338%28v=vs.85%29.aspx user[:password] = nil end end @@ -151,9 +151,9 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows def enable_account user_modify do |user| user[:flags] &= ~NetUser::UF_ACCOUNTDISABLE - #This does not set the password to nil. It (for some reason) means to ignore updating the field. - #See similar behavior for the logon_hours field documented at - #http://msdn.microsoft.com/en-us/library/windows/desktop/aa371338%28v=vs.85%29.aspx + # This does not set the password to nil. It (for some reason) means to ignore updating the field. + # See similar behavior for the logon_hours field documented at + # http://msdn.microsoft.com/en-us/library/windows/desktop/aa371338%28v=vs.85%29.aspx user[:password] = nil end end diff --git a/lib/chef/util/windows/volume.rb b/lib/chef/util/windows/volume.rb index 358a3f4bb8..ff5f46163f 100644 --- a/lib/chef/util/windows/volume.rb +++ b/lib/chef/util/windows/volume.rb @@ -16,7 +16,7 @@ # limitations under the License. # -#simple wrapper around Volume APIs. might be possible with WMI, but possibly more complex. +# simple wrapper around Volume APIs. might be possible with WMI, but possibly more complex. require "chef/win32/api/file" require "chef/util/windows" @@ -25,7 +25,7 @@ class Chef::Util::Windows::Volume < Chef::Util::Windows attr_reader :mount_point def initialize(name) - name += "\\" unless name =~ /\\$/ #trailing slash required + name += "\\" unless name =~ /\\$/ # trailing slash required @mount_point = name end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 4854fae472..306c5398fa 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -13,11 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # NOTE: This file is generated by running `rake version` in the top level of # this repo. Do not edit this manually. Edit the VERSION file and run the rake # task instead. -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! require "chef/version_string" diff --git a/lib/chef/win32/api.rb b/lib/chef/win32/api.rb index 503920a0ed..fccedd1d54 100644 --- a/lib/chef/win32/api.rb +++ b/lib/chef/win32/api.rb @@ -51,7 +51,7 @@ class Chef host.typedef :bool, :BOOL host.typedef :bool, :BOOLEAN host.typedef :uchar, :BYTE # Byte (8 bits). Declared as unsigned char - #CALLBACK: K, # Win32.API gem-specific ?? MSDN: #define CALLBACK __stdcall + # CALLBACK: K, # Win32.API gem-specific ?? MSDN: #define CALLBACK __stdcall host.typedef :char, :CHAR # 8-bit Windows (ANSI) character. See http://msdn.microsoft.com/en-us/library/dd183415%28VS.85%29.aspx host.typedef :uint32, :COLORREF # Red, green, blue (RGB) color value (32 bits). See COLORREF for more info. host.typedef :uint32, :DWORD # 32-bit unsigned integer. The range is 0 through 4,294,967,295 decimal. @@ -78,7 +78,7 @@ class Chef host.typedef :ulong, :HDESK # (L) Handle to a desktop. http://msdn.microsoft.com/en-us/library/ms682573%28VS.85%29.aspx host.typedef :ulong, :HDROP # (L) Handle to an internal drop structure. host.typedef :ulong, :HDWP # (L) Handle to a deferred window position structure. - host.typedef :ulong, :HENHMETAFILE #(L) Handle to an enhanced metafile. http://msdn.microsoft.com/en-us/library/dd145051%28VS.85%29.aspx + host.typedef :ulong, :HENHMETAFILE # (L) Handle to an enhanced metafile. http://msdn.microsoft.com/en-us/library/dd145051%28VS.85%29.aspx host.typedef :uint, :HFILE # (I) Special file handle to a file opened by OpenFile, not CreateFile. # WinDef.h: #host.typedef int HFILE; host.typedef :ulong, :HFONT # (L) Handle to a font. http://msdn.microsoft.com/en-us/library/dd162470%28VS.85%29.aspx @@ -107,7 +107,7 @@ class Chef host.typedef :int, :INT # 32-bit signed integer. The range is -2147483648 through 2147483647 decimal. host.typedef :int, :INT_PTR # Signed integer type for pointer precision. Use when casting a pointer to an integer # to perform pointer arithmetic. BaseTsd.h: - #if defined(_WIN64) host.typedef __int64 INT_PTR; #else host.typedef int INT_PTR; + # if defined(_WIN64) host.typedef __int64 INT_PTR; #else host.typedef int INT_PTR; host.typedef :int32, :INT32 # 32-bit signed integer. The range is -2,147,483,648 through +...647 decimal. host.typedef :int64, :INT64 # 64-bit signed integer. The range is –9,223,372,036,854,775,808 through +...807 host.typedef :ushort, :LANGID # Language identifier. For more information, see Locales. WinNT.h: #host.typedef WORD LANGID; @@ -122,7 +122,7 @@ class Chef host.typedef :int64, :LONGLONG # 64-bit signed integer. The range is –9,223,372,036,854,775,808 through +...807 host.typedef :long, :LONG_PTR # Signed long type for pointer precision. Use when casting a pointer to a long to # perform pointer arithmetic. BaseTsd.h: - #if defined(_WIN64) host.typedef __int64 LONG_PTR; #else host.typedef long LONG_PTR; + # if defined(_WIN64) host.typedef __int64 LONG_PTR; #else host.typedef long LONG_PTR; host.typedef :long, :LPARAM # Message parameter. WinDef.h as follows: #host.typedef LONG_PTR LPARAM; host.typedef :pointer, :LPBOOL # Pointer to a BOOL. WinDef.h as follows: #host.typedef BOOL far *LPBOOL; host.typedef :pointer, :LPBYTE # Pointer to a BYTE. WinDef.h as follows: #host.typedef BYTE far *LPBYTE; @@ -160,7 +160,7 @@ class Chef host.typedef :pointer, :PDWORD32 # Pointer to a DWORD32. host.typedef :pointer, :PDWORD64 # Pointer to a DWORD64. host.typedef :pointer, :PFLOAT # Pointer to a FLOAT. - host.typedef :pointer, :PGENERICMAPPING #Pointer to GENERIC_MAPPING + host.typedef :pointer, :PGENERICMAPPING # Pointer to GENERIC_MAPPING host.typedef :pointer, :PHALF_PTR # Pointer to a HALF_PTR. host.typedef :pointer, :PHANDLE # Pointer to a HANDLE. host.typedef :pointer, :PHKEY # Pointer to an HKEY. @@ -235,7 +235,7 @@ class Chef host.typedef :ulong_long, :USN # Update sequence number (USN). host.typedef :ushort, :WCHAR # 16-bit Unicode character. For more information, see Character Sets Used By Fonts. # In WinNT.h: host.typedef wchar_t WCHAR; - #WINAPI: K, # Calling convention for system functions. WinDef.h: define WINAPI __stdcall + # WINAPI: K, # Calling convention for system functions. WinDef.h: define WINAPI __stdcall host.typedef :ushort, :WORD # 16-bit unsigned integer. The range is 0 through 65535 decimal. host.typedef :uint, :WPARAM # Message parameter. WinDef.h as follows: host.typedef UINT_PTR WPARAM; end diff --git a/lib/chef/win32/api/error.rb b/lib/chef/win32/api/error.rb index 758eb98874..e37468c609 100644 --- a/lib/chef/win32/api/error.rb +++ b/lib/chef/win32/api/error.rb @@ -211,9 +211,9 @@ class Chef ERROR_META_EXPANSION_TOO_LONG = 208 # if "*a" > 8.3 ERROR_INVALID_SIGNAL_NUMBER = 209 ERROR_THREAD_1_INACTIVE = 210 - ERROR_INFO_NOT_AVAIL = 211 #@@ PTM 5550 + ERROR_INFO_NOT_AVAIL = 211 # @@ PTM 5550 ERROR_LOCKED = 212 - ERROR_BAD_DYNALINK = 213 #@@ PTM 5760 + ERROR_BAD_DYNALINK = 213 # @@ PTM 5760 ERROR_TOO_MANY_MODULES = 214 ERROR_NESTING_NOT_ALLOWED = 215 ERROR_EXE_MACHINE_TYPE_MISMATCH = 216 diff --git a/lib/chef/win32/api/file.rb b/lib/chef/win32/api/file.rb index 6aa2927e1f..a239671557 100644 --- a/lib/chef/win32/api/file.rb +++ b/lib/chef/win32/api/file.rb @@ -461,22 +461,22 @@ BOOL WINAPI DeviceIoControl( =end safe_attach_function :DeviceIoControl, [:HANDLE, :DWORD, :LPVOID, :DWORD, :LPVOID, :DWORD, :LPDWORD, :pointer], :BOOL -#BOOL WINAPI DeleteVolumeMountPoint( - #_In_ LPCTSTR lpszVolumeMountPoint -#); +# BOOL WINAPI DeleteVolumeMountPoint( + # _In_ LPCTSTR lpszVolumeMountPoint +# ); safe_attach_function :DeleteVolumeMountPointW, [:LPCTSTR], :BOOL -#BOOL WINAPI SetVolumeMountPoint( - #_In_ LPCTSTR lpszVolumeMountPoint, - #_In_ LPCTSTR lpszVolumeName -#); +# BOOL WINAPI SetVolumeMountPoint( + # _In_ LPCTSTR lpszVolumeMountPoint, + # _In_ LPCTSTR lpszVolumeName +# ); safe_attach_function :SetVolumeMountPointW, [:LPCTSTR, :LPCTSTR], :BOOL -#BOOL WINAPI GetVolumeNameForVolumeMountPoint( - #_In_ LPCTSTR lpszVolumeMountPoint, - #_Out_ LPTSTR lpszVolumeName, - #_In_ DWORD cchBufferLength -#); +# BOOL WINAPI GetVolumeNameForVolumeMountPoint( + # _In_ LPCTSTR lpszVolumeMountPoint, + # _Out_ LPTSTR lpszVolumeName, + # _In_ DWORD cchBufferLength +# ); safe_attach_function :GetVolumeNameForVolumeMountPointW, [:LPCTSTR, :LPTSTR, :DWORD], :BOOL =begin diff --git a/lib/chef/win32/api/net.rb b/lib/chef/win32/api/net.rb index 169c68bbdf..e7c191dd9c 100644 --- a/lib/chef/win32/api/net.rb +++ b/lib/chef/win32/api/net.rb @@ -43,7 +43,7 @@ class Chef USE_NOFORCE = 0 USE_FORCE = 1 - USE_LOTS_OF_FORCE = 2 #every windows API should support this flag + USE_LOTS_OF_FORCE = 2 # every windows API should support this flag NERR_Success = 0 # rubocop:disable Naming/ConstantName ERROR_MORE_DATA = 234 @@ -158,32 +158,32 @@ class Chef :ui2_domainname, :LMSTR end - #NET_API_STATUS NetLocalGroupAdd( - #_In_ LPCWSTR servername, - #_In_ DWORD level, - #_In_ LPBYTE buf, - #_Out_ LPDWORD parm_err - #); + # NET_API_STATUS NetLocalGroupAdd( + # _In_ LPCWSTR servername, + # _In_ DWORD level, + # _In_ LPBYTE buf, + # _Out_ LPDWORD parm_err + # ); safe_attach_function :NetLocalGroupAdd, [ :LPCWSTR, :DWORD, :LPBYTE, :LPDWORD ], :DWORD - #NET_API_STATUS NetLocalGroupDel( - #_In_ LPCWSTR servername, - #_In_ LPCWSTR groupname - #); + # NET_API_STATUS NetLocalGroupDel( + # _In_ LPCWSTR servername, + # _In_ LPCWSTR groupname + # ); safe_attach_function :NetLocalGroupDel, [:LPCWSTR, :LPCWSTR], :DWORD - #NET_API_STATUS NetLocalGroupGetMembers( - #_In_ LPCWSTR servername, - #_In_ LPCWSTR localgroupname, - #_In_ DWORD level, - #_Out_ LPBYTE *bufptr, - #_In_ DWORD prefmaxlen, - #_Out_ LPDWORD entriesread, - #_Out_ LPDWORD totalentries, - #_Inout_ PDWORD_PTR resumehandle - #); + # NET_API_STATUS NetLocalGroupGetMembers( + # _In_ LPCWSTR servername, + # _In_ LPCWSTR localgroupname, + # _In_ DWORD level, + # _Out_ LPBYTE *bufptr, + # _In_ DWORD prefmaxlen, + # _Out_ LPDWORD entriesread, + # _Out_ LPDWORD totalentries, + # _Inout_ PDWORD_PTR resumehandle + # ); safe_attach_function :NetLocalGroupGetMembers, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :DWORD, :LPDWORD, :LPDWORD, :PDWORD_PTR @@ -209,102 +209,102 @@ class Chef # ); safe_attach_function :NetApiBufferFree, [:LPVOID], :DWORD - #NET_API_STATUS NetUserAdd( - #_In_ LMSTR servername, - #_In_ DWORD level, - #_In_ LPBYTE buf, - #_Out_ LPDWORD parm_err - #); + # NET_API_STATUS NetUserAdd( + # _In_ LMSTR servername, + # _In_ DWORD level, + # _In_ LPBYTE buf, + # _Out_ LPDWORD parm_err + # ); safe_attach_function :NetUserAdd, [ :LMSTR, :DWORD, :LPBYTE, :LPDWORD ], :DWORD - #NET_API_STATUS NetLocalGroupAddMembers( + # NET_API_STATUS NetLocalGroupAddMembers( # _In_ LPCWSTR servername, # _In_ LPCWSTR groupname, # _In_ DWORD level, # _In_ LPBYTE buf, # _In_ DWORD totalentries - #); + # ); safe_attach_function :NetLocalGroupAddMembers, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :DWORD ], :DWORD - #NET_API_STATUS NetLocalGroupSetMembers( + # NET_API_STATUS NetLocalGroupSetMembers( # _In_ LPCWSTR servername, # _In_ LPCWSTR groupname, # _In_ DWORD level, # _In_ LPBYTE buf, # _In_ DWORD totalentries - #); + # ); safe_attach_function :NetLocalGroupSetMembers, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :DWORD ], :DWORD - #NET_API_STATUS NetLocalGroupDelMembers( + # NET_API_STATUS NetLocalGroupDelMembers( # _In_ LPCWSTR servername, # _In_ LPCWSTR groupname, # _In_ DWORD level, # _In_ LPBYTE buf, # _In_ DWORD totalentries - #); + # ); safe_attach_function :NetLocalGroupDelMembers, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :DWORD ], :DWORD - #NET_API_STATUS NetUserGetInfo( + # NET_API_STATUS NetUserGetInfo( # _In_ LPCWSTR servername, # _In_ LPCWSTR username, # _In_ DWORD level, # _Out_ LPBYTE *bufptr - #); + # ); safe_attach_function :NetUserGetInfo, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE ], :DWORD - #NET_API_STATUS NetApiBufferFree( + # NET_API_STATUS NetApiBufferFree( # _In_ LPVOID Buffer - #); + # ); safe_attach_function :NetApiBufferFree, [:LPVOID], :DWORD - #NET_API_STATUS NetUserSetInfo( + # NET_API_STATUS NetUserSetInfo( # _In_ LPCWSTR servername, # _In_ LPCWSTR username, # _In_ DWORD level, # _In_ LPBYTE buf, # _Out_ LPDWORD parm_err - #); + # ); safe_attach_function :NetUserSetInfo, [ :LPCWSTR, :LPCWSTR, :DWORD, :LPBYTE, :LPDWORD ], :DWORD - #NET_API_STATUS NetUserDel( + # NET_API_STATUS NetUserDel( # _In_ LPCWSTR servername, # _In_ LPCWSTR username - #); + # ); safe_attach_function :NetUserDel, [:LPCWSTR, :LPCWSTR], :DWORD - #NET_API_STATUS NetUseDel( - #_In_ LMSTR UncServerName, - #_In_ LMSTR UseName, - #_In_ DWORD ForceCond - #); + # NET_API_STATUS NetUseDel( + # _In_ LMSTR UncServerName, + # _In_ LMSTR UseName, + # _In_ DWORD ForceCond + # ); safe_attach_function :NetUseDel, [:LMSTR, :LMSTR, :DWORD], :DWORD - #NET_API_STATUS NetUseGetInfo( - #_In_ LMSTR UncServerName, - #_In_ LMSTR UseName, - #_In_ DWORD Level, - #_Out_ LPBYTE *BufPtr - #); + # NET_API_STATUS NetUseGetInfo( + # _In_ LMSTR UncServerName, + # _In_ LMSTR UseName, + # _In_ DWORD Level, + # _Out_ LPBYTE *BufPtr + # ); safe_attach_function :NetUseGetInfo, [:LMSTR, :LMSTR, :DWORD, :pointer], :DWORD - #NET_API_STATUS NetUseAdd( - #_In_ LMSTR UncServerName, - #_In_ DWORD Level, - #_In_ LPBYTE Buf, - #_Out_ LPDWORD ParmError - #); + # NET_API_STATUS NetUseAdd( + # _In_ LMSTR UncServerName, + # _In_ DWORD Level, + # _In_ LPBYTE Buf, + # _Out_ LPDWORD ParmError + # ); safe_attach_function :NetUseAdd, [:LMSTR, :DWORD, :LPBYTE, :LPDWORD], :DWORD end end diff --git a/lib/chef/win32/security/securable_object.rb b/lib/chef/win32/security/securable_object.rb index 16841413b7..f0bbfc7354 100644 --- a/lib/chef/win32/security/securable_object.rb +++ b/lib/chef/win32/security/securable_object.rb @@ -42,10 +42,10 @@ class Chef # compare an existing ACE with one you want to create. def predict_rights_mask(generic_mask) mask = generic_mask - #mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_READ if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_READ) != 0 - #mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_WRITE if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_WRITE) != 0 - #mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_EXECUTE if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_EXECUTE) != 0 - #mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_ALL if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_ALL) != 0 + # mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_READ if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_READ) != 0 + # mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_WRITE if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_WRITE) != 0 + # mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_EXECUTE if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_EXECUTE) != 0 + # mask |= Chef::ReservedNames::Win32::API::Security::STANDARD_RIGHTS_ALL if (mask | Chef::ReservedNames::Win32::API::Security::GENERIC_ALL) != 0 if type == :SE_FILE_OBJECT mask |= Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_READ if (mask & Chef::ReservedNames::Win32::API::Security::GENERIC_READ) != 0 mask |= Chef::ReservedNames::Win32::API::Security::FILE_GENERIC_WRITE if (mask & Chef::ReservedNames::Win32::API::Security::GENERIC_WRITE) != 0 diff --git a/spec/functional/knife/exec_spec.rb b/spec/functional/knife/exec_spec.rb index ac8f617a90..7cdf1c93eb 100644 --- a/spec/functional/knife/exec_spec.rb +++ b/spec/functional/knife/exec_spec.rb @@ -21,7 +21,7 @@ require "tiny_server" describe Chef::Knife::Exec do before(:each) do - @server = TinyServer::Manager.new #(:debug => true) + @server = TinyServer::Manager.new # (:debug => true) @server.start end diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb index 2b8b509730..4464b6ed69 100644 --- a/spec/functional/resource/link_spec.rb +++ b/spec/functional/resource/link_spec.rb @@ -19,7 +19,7 @@ require "spec_helper" if windows? - require "chef/win32/file" #probably need this in spec_helper + require "chef/win32/file" # probably need this in spec_helper require "chef/win32/security" end diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb index 2a11cdb63f..8de6577759 100644 --- a/spec/functional/resource/registry_spec.rb +++ b/spec/functional/resource/registry_spec.rb @@ -107,7 +107,7 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do reset_registry end - #Reporting setup + # Reporting setup before do @node.name("windowsbox") @@ -569,7 +569,7 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do expect(@report["resources"][0]["id"]).to eq(reg_parent + '\ReportKey') expect(@report["resources"][0]["before"][:values]).to eq([{ name: "ReportVal4", type: :string, data: "report4" }, { name: "ReportVal5", type: :string, data: "report5" }]) - #Not testing for after values to match since after -> new_resource values. + # Not testing for after values to match since after -> new_resource values. expect(@report["resources"][0]["result"]).to eq("delete") expect(@report["status"]).to eq("success") expect(@report["total_res_count"]).to eq("1") @@ -622,7 +622,7 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do it "ignores the values under a key" do @new_resource.key(reg_parent + '\OpscodeIgnoredValues') - #@new_resource.values([{:name=>"DontExist", :type=>:string, :data=>"These will be ignored anyways"}]) + # @new_resource.values([{:name=>"DontExist", :type=>:string, :data=>"These will be ignored anyways"}]) @new_resource.recursive(true) @new_resource.run_action(:delete_key) end @@ -645,9 +645,9 @@ describe Chef::Resource::RegistryKey, :windows_only, broken: true do expect(@report["resources"][0]["type"]).to eq("registry_key") expect(@report["resources"][0]["name"]).to eq(resource_name) expect(@report["resources"][0]["id"]).to eq(reg_parent + '\ReportKey') - #Not testing for before or after values to match since - #after -> new_resource.values and - #before -> current_resource.values + # Not testing for before or after values to match since + # after -> new_resource.values and + # before -> current_resource.values expect(@report["resources"][0]["result"]).to eq("delete_key") expect(@report["status"]).to eq("success") expect(@report["total_res_count"]).to eq("1") diff --git a/spec/functional/resource/remote_file_spec.rb b/spec/functional/resource/remote_file_spec.rb index 8e484b2968..a121cbb1f3 100644 --- a/spec/functional/resource/remote_file_spec.rb +++ b/spec/functional/resource/remote_file_spec.rb @@ -360,7 +360,7 @@ describe Chef::Resource::RemoteFile do it "should raise ContentLengthMismatch" do expect { resource.run_action(:create) }.to raise_error(Chef::Exceptions::ContentLengthMismatch) - #File.should_not exist(path) # XXX: CHEF-5081 + # File.should_not exist(path) # XXX: CHEF-5081 end end @@ -373,7 +373,7 @@ describe Chef::Resource::RemoteFile do it "should raise ContentLengthMismatch" do expect { resource.run_action(:create) }.to raise_error(Chef::Exceptions::ContentLengthMismatch) - #File.should_not exist(path) # XXX: CHEF-5081 + # File.should_not exist(path) # XXX: CHEF-5081 end end diff --git a/spec/functional/resource/windows_task_spec.rb b/spec/functional/resource/windows_task_spec.rb index 46fbfe2e82..05f46d20ce 100644 --- a/spec/functional/resource/windows_task_spec.rb +++ b/spec/functional/resource/windows_task_spec.rb @@ -46,7 +46,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates scheduled task and sets command arguments" do subject.command "chef-client -W" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) expect(current_resource.task.application_name).to eq("chef-client") @@ -64,7 +64,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates scheduled task and sets command arguments" do subject.command "chef-client -W -L 'C:\\chef\\chef-ad-join.log'" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) expect(current_resource.task.application_name).to eq("chef-client") @@ -82,7 +82,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates scheduled task and sets command arguments" do subject.command '"C:\\Program Files\\example\program.exe" -arg1 --arg2' call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) expect(current_resource.task.application_name).to eq("C:\\Program Files\\example\\program.exe") @@ -100,7 +100,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates scheduled task and sets command arguments" do subject.command "ping http://www.google.com" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) expect(current_resource.task.application_name).to eq("ping") @@ -129,7 +129,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates a scheduled task to run every 1 hr starting on 09/20/2017" do call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) expect(current_resource.task.application_name).to eq(task_name) @@ -161,7 +161,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates a scheduled task that runs after every 15 minutes" do call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -209,7 +209,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates a scheduled task that runs after every 3 hrs" do call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -254,7 +254,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates a scheduled task to run daily" do call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -289,7 +289,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "if day property is not set creates a scheduled task to run monthly on first day of the month" do call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -309,7 +309,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates a scheduled task to run monthly on first, second and third day of the month" do subject.day "1, 2, 3" call_for_create_action - #loading current resource again to check new task is created and it matches task parameters + # loading current resource again to check new task is created and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -330,15 +330,15 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates a scheduled task to run monthly on 1, 2, 3, 4, 8, 20, 21, 15, 28, 31 day of the month" do subject.day "1, 2, 3, 4, 8, 20, 21, 15, 28, 31" call_for_create_action - #loading current resource again to check new task is created and it matches task parameters + # loading current resource again to check new task is created and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) expect(current_resource.task.application_name).to eq(task_name) expect(trigger_details[:trigger_type]).to eq(4) expect(current_resource.task.principals[:run_level]).to eq(1) - expect(trigger_details[:type][:days]).to eq(1209548943) #TODO:: windows_task_provider.send(:days_of_month) - expect(trigger_details[:type][:months]).to eq(4095) #windows_task_provider.send(:months_of_year) + expect(trigger_details[:type][:days]).to eq(1209548943) # TODO:: windows_task_provider.send(:days_of_month) + expect(trigger_details[:type][:months]).to eq(4095) # windows_task_provider.send(:months_of_year) end it "does not converge the resource if it is already converged" do @@ -352,15 +352,15 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.day "1, 2, 3, 4, 8, 20, 21, 30" subject.months "Jan, Feb, May, Sep, Dec" call_for_create_action - #loading current resource again to check new task is created and it matches task parameters + # loading current resource again to check new task is created and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) expect(current_resource.task.application_name).to eq(task_name) expect(trigger_details[:trigger_type]).to eq(4) expect(current_resource.task.principals[:run_level]).to eq(1) - expect(trigger_details[:type][:days]).to eq(538443919) #TODO:windows_task_provider.send(:days_of_month) - expect(trigger_details[:type][:months]).to eq(2323) #windows_task_provider.send(:months_of_year) + expect(trigger_details[:type][:days]).to eq(538443919) # TODO:windows_task_provider.send(:days_of_month) + expect(trigger_details[:type][:months]).to eq(2323) # windows_task_provider.send(:months_of_year) end it "does not converge the resource if it is already converged" do @@ -375,7 +375,7 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.frequency_modifier "First" subject.day "Mon, Fri, Sun" call_for_create_action - #loading current resource again to check new task is created and it matches task parameters + # loading current resource again to check new task is created and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -384,7 +384,7 @@ describe Chef::Resource::WindowsTask, :windows_only do expect(current_resource.task.principals[:run_level]).to eq(1) expect(trigger_details[:type][:days_of_week]).to eq(35) expect(trigger_details[:type][:weeks_of_month]).to eq(1) - expect(trigger_details[:type][:months]).to eq(4095) #windows_task_provider.send(:months_of_year) + expect(trigger_details[:type][:months]).to eq(4095) # windows_task_provider.send(:months_of_year) end it "does not converge the resource if it is already converged" do @@ -606,7 +606,7 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.day "2" subject.start_day "03/07/2018" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -628,7 +628,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates a scheduled task to run monthly on first, second and third day of the month" do subject.day "1,2,3" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -649,7 +649,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates a scheduled task to run monthly on each wednesday of the month" do subject.frequency_modifier "1" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -657,7 +657,7 @@ describe Chef::Resource::WindowsTask, :windows_only do expect(trigger_details[:trigger_type]).to eq(4) expect(current_resource.task.principals[:run_level]).to eq(1) expect(trigger_details[:type][:days]).to eq(1) - expect(trigger_details[:type][:months]).to eq(4095) #windows_task_provider.send(:months_of_year) + expect(trigger_details[:type][:months]).to eq(4095) # windows_task_provider.send(:months_of_year) end it "does not converge the resource if it is already converged" do @@ -671,16 +671,16 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.frequency_modifier "2" subject.months = nil call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) - #loading current resource + # loading current resource expect(current_resource.task.application_name).to eq(task_name) expect(trigger_details[:trigger_type]).to eq(4) expect(current_resource.task.principals[:run_level]).to eq(1) expect(trigger_details[:type][:days]).to eq(1) - expect(trigger_details[:type][:months]).to eq(2730) #windows_task_provider.send(:months_of_year) + expect(trigger_details[:type][:months]).to eq(2730) # windows_task_provider.send(:months_of_year) end it "does not converge the resource if it is already converged" do @@ -714,7 +714,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates the scheduled task to run once at 5pm" do subject.start_time "17:00" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -745,7 +745,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates the scheduled task to run weekly" do call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -765,7 +765,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates hte scheduled task for all days of week" do subject.day "*" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -789,7 +789,7 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.day "Mon, Fri" subject.frequency_modifier 2 call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -894,7 +894,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates the scheduled task to run at system start up" do call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -914,7 +914,7 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.start_day "09/10/2018" subject.start_time "15:00" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -941,7 +941,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates the scheduled task to on logon" do call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -961,7 +961,7 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.start_day "09/10/2018" subject.start_time "15:00" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -996,7 +996,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates the scheduled task to run when system is idle" do subject.idle_time 20 call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -1021,7 +1021,7 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.start_day "09/10/2018" subject.start_time "15:00" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -1049,7 +1049,7 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.frequency :minute subject.random_delay "20" call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) trigger_details = current_resource.task.trigger(0) @@ -1092,7 +1092,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "creates the scheduled task to run on demand only" do call_for_create_action - #loading current resource again to check new task is creted and it matches task parameters + # loading current resource again to check new task is creted and it matches task parameters current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) @@ -1514,7 +1514,7 @@ describe Chef::Resource::WindowsTask, :windows_only do subject.run_action(:run) subject.run_action(:end) current_resource = call_for_load_current_resource - expect(current_resource.task.status).to eq("queued").or eq("ready") #queued or can be ready + expect(current_resource.task.status).to eq("queued").or eq("ready") # queued or can be ready end end diff --git a/spec/functional/run_lock_spec.rb b/spec/functional/run_lock_spec.rb index c1942cff50..49972360ef 100644 --- a/spec/functional/run_lock_spec.rb +++ b/spec/functional/run_lock_spec.rb @@ -461,7 +461,7 @@ describe Chef::RunLock do buffer << fd.read_nonblock(1) while buffer[-1] != "\n" buffer - #rescue IO::EAGAINUnreadable + # rescue IO::EAGAINUnreadable rescue IO::WaitReadable unless buffer == "" sleep 0.1 diff --git a/spec/functional/win32/registry_spec.rb b/spec/functional/win32/registry_spec.rb index c5323d3557..923b952161 100644 --- a/spec/functional/win32/registry_spec.rb +++ b/spec/functional/win32/registry_spec.rb @@ -23,7 +23,7 @@ require "chef/win32/registry" describe "Chef::Win32::Registry", :windows_only do before(:all) do - #Create a registry item + # Create a registry item ::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root" ::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root\\Branch" ::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root\\B®anch" @@ -39,17 +39,17 @@ describe "Chef::Win32::Registry", :windows_only do reg["Petals", Win32::Registry::REG_MULTI_SZ] = %w{Pink Delicate} end - #Create the node with ohai data + # Create the node with ohai data events = Chef::EventDispatch::Dispatcher.new @node = Chef::Node.new @node.consume_external_attrs(OHAI_SYSTEM.data, {}) @run_context = Chef::RunContext.new(@node, {}, events) - #Create a registry object that has access ot the node previously created + # Create a registry object that has access ot the node previously created @registry = Chef::Win32::Registry.new(@run_context) end - #Delete what is left of the registry key-values previously created + # Delete what is left of the registry key-values previously created after(:all) do ::Win32::Registry::HKEY_CURRENT_USER.open("Software") do |reg| reg.delete_key("Root", true) diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb index 0df006cccc..2abae030c2 100644 --- a/spec/support/shared/functional/securable_resource.rb +++ b/spec/support/shared/functional/securable_resource.rb @@ -443,8 +443,8 @@ shared_examples_for "a securable resource without existing target" do end it "respects mode in string form as an octal number" do - #on windows, mode cannot modify owner and/or group permissons - #unless the owner and/or group as appropriate is specified + # on windows, mode cannot modify owner and/or group permissons + # unless the owner and/or group as appropriate is specified resource.mode "400" resource.owner "Guest" resource.group "Everyone" diff --git a/spec/support/shared/unit/api_error_inspector.rb b/spec/support/shared/unit/api_error_inspector.rb index 06f2e4bb57..15c122e3dc 100644 --- a/spec/support/shared/unit/api_error_inspector.rb +++ b/spec/support/shared/unit/api_error_inspector.rb @@ -36,7 +36,7 @@ shared_examples_for "an api error inspector" do } @description = Chef::Formatters::ErrorDescription.new("Error registering the node:") @outputter = Chef::Formatters::IndentableOutputStream.new(StringIO.new, STDERR) - #@outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR) + # @outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR) end diff --git a/spec/support/shared/unit/provider/useradd_based_user_provider.rb b/spec/support/shared/unit/provider/useradd_based_user_provider.rb index 3e48cdf92d..a30f543e72 100644 --- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb +++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb @@ -266,7 +266,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option # :nil_object => true, # :username => "adam" # ) - #provider = Chef::Provider::User::Useradd.new(@node, @new_resource) + # provider = Chef::Provider::User::Useradd.new(@node, @new_resource) @stdout = "root P 09/02/2008 0 99999 7 -1" @stderr = "" end diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb index a342fbd8bf..b8d7242466 100644 --- a/spec/unit/application_spec.rb +++ b/spec/unit/application_spec.rb @@ -107,7 +107,7 @@ describe Chef::Application do it "should parse the commandline options" do expect(@app).to receive(:parse_options).and_return(true) - @app.config[:config_file] = "/etc/chef/default.rb" #have a config file set, to prevent triggering error block + @app.config[:config_file] = "/etc/chef/default.rb" # have a config file set, to prevent triggering error block @app.configure_chef end @@ -138,7 +138,7 @@ describe Chef::Application do end it "should merge the local config hash into chef::config" do - #File.should_receive(:open).with("/etc/chef/default.rb").and_yield(@config_file) + # File.should_receive(:open).with("/etc/chef/default.rb").and_yield(@config_file) @app.configure_chef expect(Chef::Config.rspec_ran).to eq("true") end diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index b39dde297e..4f9d66d776 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -488,7 +488,7 @@ EOM context "fatal admin check is configured" do it "should not raise an exception" do - client.do_windows_admin_check #should not raise + client.do_windows_admin_check # should not raise end end end diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb index 7d7b6137bb..4da1c57964 100644 --- a/spec/unit/cookbook/metadata_spec.rb +++ b/spec/unit/cookbook/metadata_spec.rb @@ -558,14 +558,14 @@ describe Chef::Cookbook::Metadata do expect do metadata.attribute("db/mysql/databases", required: true) end.not_to raise_error - #attrib = metadata.attributes["db/mysql/databases"][:required].should == "required" + # attrib = metadata.attributes["db/mysql/databases"][:required].should == "required" end it "should convert required false to optional" do expect do metadata.attribute("db/mysql/databases", required: false) end.not_to raise_error - #attrib = metadata.attributes["db/mysql/databases"][:required].should == "optional" + # attrib = metadata.attributes["db/mysql/databases"][:required].should == "optional" end it "should set required to 'optional' by default" do diff --git a/spec/unit/daemon_spec.rb b/spec/unit/daemon_spec.rb index ffcdb71259..6722fbe12c 100644 --- a/spec/unit/daemon_spec.rb +++ b/spec/unit/daemon_spec.rb @@ -24,7 +24,7 @@ describe Chef::Daemon do before do if windows? - mock_struct = #Struct::Passwd.new(nil, nil, 111, 111) + mock_struct = # Struct::Passwd.new(nil, nil, 111, 111) mock_struct = OpenStruct.new(uid: 2342, gid: 2342) allow(Etc).to receive(:getpwnam).and_return mock_struct allow(Etc).to receive(:getgrnam).and_return mock_struct diff --git a/spec/unit/file_access_control_spec.rb b/spec/unit/file_access_control_spec.rb index de23fea1f3..b9ef45dd5c 100644 --- a/spec/unit/file_access_control_spec.rb +++ b/spec/unit/file_access_control_spec.rb @@ -273,7 +273,7 @@ describe Chef::FileAccessControl do it "sets the file's mode as specified in the resource when the current modes are incorrect" do # stat returns modes like 0100644 (octal) => 33188 (decimal) - #@fac.stub(:stat).and_return(OpenStruct.new(:mode => 33188)) + # @fac.stub(:stat).and_return(OpenStruct.new(:mode => 33188)) @current_resource.mode("0644") expect(File).to receive(:chmod).with(256, "/tmp/different_file.txt") @fac.set_mode @@ -286,7 +286,7 @@ describe Chef::FileAccessControl do end it "does not set the file's mode when the current modes are correct" do - #@fac.stub(:stat).and_return(OpenStruct.new(:mode => 0100400)) + # @fac.stub(:stat).and_return(OpenStruct.new(:mode => 0100400)) @current_resource.mode("0400") expect(File).not_to receive(:chmod) @fac.set_mode diff --git a/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb index 02846af24a..437cc3ee49 100644 --- a/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb @@ -22,7 +22,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookSyncErrorInspector do before do @description = Chef::Formatters::ErrorDescription.new("Error Expanding RunList:") @outputter = Chef::Formatters::IndentableOutputStream.new(StringIO.new, STDERR) - #@outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR) + # @outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR) end describe "when explaining a 502 error" do diff --git a/spec/unit/formatters/error_inspectors/node_load_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/node_load_error_inspector_spec.rb index 93aac417fa..84a3804dc2 100644 --- a/spec/unit/formatters/error_inspectors/node_load_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/node_load_error_inspector_spec.rb @@ -19,7 +19,7 @@ require "spec_helper" # spec_helper loads the shared examples already. -#require 'support/shared/unit/api_error_inspector_spec' +# require 'support/shared/unit/api_error_inspector_spec' describe Chef::Formatters::ErrorInspectors::NodeLoadErrorInspector do it_behaves_like "an api error inspector" diff --git a/spec/unit/formatters/error_inspectors/registration_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/registration_error_inspector_spec.rb index cea93888eb..63a841ccda 100644 --- a/spec/unit/formatters/error_inspectors/registration_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/registration_error_inspector_spec.rb @@ -19,7 +19,7 @@ require "spec_helper" # spec_helper loads the shared examples already. -#require 'support/shared/unit/api_error_inspector_spec' +# require 'support/shared/unit/api_error_inspector_spec' describe Chef::Formatters::ErrorInspectors::RegistrationErrorInspector do it_behaves_like "an api error inspector" diff --git a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb index 072dcfef28..0cdb06c3b3 100644 --- a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb @@ -40,7 +40,7 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do @description = Chef::Formatters::ErrorDescription.new("Error Converging Resource:") @stdout = StringIO.new @outputter = Chef::Formatters::IndentableOutputStream.new(@stdout, STDERR) - #@outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR) + # @outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR) allow(Chef::Config).to receive(:cookbook_path).and_return([ "/var/chef/cache" ]) end diff --git a/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb index 6c03750136..70cf96f7c9 100644 --- a/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb @@ -27,7 +27,7 @@ describe Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector do @description = Chef::Formatters::ErrorDescription.new("Error Expanding RunList:") @outputter = Chef::Formatters::IndentableOutputStream.new(StringIO.new, STDERR) - #@outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR) + # @outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR) end describe "when explaining a missing role error" do diff --git a/spec/unit/http/ssl_policies_spec.rb b/spec/unit/http/ssl_policies_spec.rb index df6dee1198..b67ecc84de 100644 --- a/spec/unit/http/ssl_policies_spec.rb +++ b/spec/unit/http/ssl_policies_spec.rb @@ -145,7 +145,7 @@ describe "HTTP SSL Policy" do # For whatever reason, OpenSSL errors out when adding a # cert you already have to the certificate store. ssl_policy.set_custom_certs - ssl_policy.set_custom_certs #should not raise an error + ssl_policy.set_custom_certs # should not raise an error end end end diff --git a/spec/unit/key_spec.rb b/spec/unit/key_spec.rb index 0809483577..ea2eae3df7 100644 --- a/spec/unit/key_spec.rb +++ b/spec/unit/key_spec.rb @@ -564,7 +564,7 @@ EOS end end - end #update + end # update describe "load" do shared_examples_for "load" do @@ -592,7 +592,7 @@ EOS end end - end #load + end # load describe "destroy" do shared_examples_for "destroy key" do diff --git a/spec/unit/knife/cookbook_site_install_spec.rb b/spec/unit/knife/cookbook_site_install_spec.rb index d5df88c997..4e9c7b6265 100644 --- a/spec/unit/knife/cookbook_site_install_spec.rb +++ b/spec/unit/knife/cookbook_site_install_spec.rb @@ -173,7 +173,7 @@ describe Chef::Knife::CookbookSiteInstall do it "returns a populated Metadata object if metadata.json exists" do allow(File).to receive(:exist?).with(json_metadata_path).and_return(true) - #expect(IO).to receive(:read).with(json_metadata_path) + # expect(IO).to receive(:read).with(json_metadata_path) allow(IO).to receive(:read) expect(metadata).to receive(:from_json) knife.preferred_metadata diff --git a/spec/unit/knife/cookbook_site_share_spec.rb b/spec/unit/knife/cookbook_site_share_spec.rb index ac12536d6e..773c1a78c3 100644 --- a/spec/unit/knife/cookbook_site_share_spec.rb +++ b/spec/unit/knife/cookbook_site_share_spec.rb @@ -199,8 +199,8 @@ describe Chef::Knife::CookbookSiteShare do response_text = Chef::JSONCompat.to_json({ system_error: "Your call was dropped", reason: "There's a map for that" }) allow(@upload_response).to receive(:body).and_return(response_text) allow(@upload_response).to receive(:code).and_return(500) - expect(@knife.ui).to receive(:error).with(/#{Regexp.escape(response_text)}/) #.ordered - expect(@knife.ui).to receive(:error).with(/Unknown error/) #.ordered + expect(@knife.ui).to receive(:error).with(/#{Regexp.escape(response_text)}/) # .ordered + expect(@knife.ui).to receive(:error).with(/Unknown error/) # .ordered expect { @knife.run }.to raise_error(SystemExit) end diff --git a/spec/unit/knife/core/object_loader_spec.rb b/spec/unit/knife/core/object_loader_spec.rb index 9cabf2ba63..6eb392acae 100644 --- a/spec/unit/knife/core/object_loader_spec.rb +++ b/spec/unit/knife/core/object_loader_spec.rb @@ -57,7 +57,7 @@ describe Chef::Knife::Core::ObjectLoader do it_behaves_like "Chef object", chef_class end - #NOTE: This is check for the bug described at CHEF-2352 + # NOTE: This is check for the bug described at CHEF-2352 describe "when the file is a JSON" do describe "and it has defined 'json_class'" do before do diff --git a/spec/unit/knife/key_create_spec.rb b/spec/unit/knife/key_create_spec.rb index 2d882b87e0..fcbfd40381 100644 --- a/spec/unit/knife/key_create_spec.rb +++ b/spec/unit/knife/key_create_spec.rb @@ -207,7 +207,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo end end # when the server returns a private key end # when the command is run - end #key create run command" + end # key create run command" context "when actor_field_name is 'user'" do it_should_behave_like "key create run command" do diff --git a/spec/unit/knife/role_env_run_list_add_spec.rb b/spec/unit/knife/role_env_run_list_add_spec.rb index e679b88295..242beeb4a2 100644 --- a/spec/unit/knife/role_env_run_list_add_spec.rb +++ b/spec/unit/knife/role_env_run_list_add_spec.rb @@ -85,17 +85,17 @@ describe Chef::Knife::RoleEnvRunListAdd do end it "should add to the run list after the specified entries in the QA run list" do - #Setup + # Setup @role.run_list_for("_default") << "role[acorns]" @role.run_list_for("_default") << "role[barn]" @knife.run @role.run_list_for("QA") << "role[pencil]" @role.run_list_for("QA") << "role[pen]" - #Configuration we are testing + # Configuration we are testing @knife.config[:after] = "role[pencil]" @knife.name_args = [ "will", "QA", "role[pad]", "role[whackadoo]" ] @knife.run - #The actual tests + # The actual tests expect(@role.run_list_for("QA")[0]).to eq("role[monkey]") expect(@role.run_list_for("QA")[1]).to eq("role[pencil]") expect(@role.run_list_for("QA")[2]).to eq("role[pad]") diff --git a/spec/unit/knife/role_run_list_add_spec.rb b/spec/unit/knife/role_run_list_add_spec.rb index 3358da130c..a38b6de9da 100644 --- a/spec/unit/knife/role_run_list_add_spec.rb +++ b/spec/unit/knife/role_run_list_add_spec.rb @@ -74,14 +74,14 @@ describe Chef::Knife::RoleRunListAdd do end it "should add to the run list after the specified entries in the default run list" do - #Setup + # Setup @role.run_list_for("_default") << "role[acorns]" @role.run_list_for("_default") << "role[barn]" - #Configuration we are testing + # Configuration we are testing @knife.config[:after] = "role[acorns]" @knife.name_args = [ "will", "role[pad]", "role[whackadoo]" ] @knife.run - #The actual tests + # The actual tests expect(@role.run_list[0]).to eq("role[acorns]") expect(@role.run_list[1]).to eq("role[pad]") expect(@role.run_list[2]).to eq("role[whackadoo]") diff --git a/spec/unit/knife/ssl_check_spec.rb b/spec/unit/knife/ssl_check_spec.rb index a25c8b759c..9092110b95 100644 --- a/spec/unit/knife/ssl_check_spec.rb +++ b/spec/unit/knife/ssl_check_spec.rb @@ -168,8 +168,8 @@ E def run ssl_check.run rescue Exception - #puts "OUT: #{stdout_io.string}" - #puts "ERR: #{stderr_io.string}" + # puts "OUT: #{stdout_io.string}" + # puts "ERR: #{stderr_io.string}" raise end diff --git a/spec/unit/knife/user_delete_spec.rb b/spec/unit/knife/user_delete_spec.rb index 0f71b39a41..68749fe727 100644 --- a/spec/unit/knife/user_delete_spec.rb +++ b/spec/unit/knife/user_delete_spec.rb @@ -51,7 +51,7 @@ describe Chef::Knife::UserDelete do end it "deletes the user" do - #expect(knife).to receive(:delete_object).with(Chef::UserV1, 'my_user') + # expect(knife).to receive(:delete_object).with(Chef::UserV1, 'my_user') expect(knife).to receive(:delete_object).with("my_user") knife.run end diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb index 443e21659e..c091286077 100644 --- a/spec/unit/knife_spec.rb +++ b/spec/unit/knife_spec.rb @@ -300,14 +300,14 @@ describe Chef::Knife do end it "prefers the default value if no config or command line value is present" do - knife_command = KnifeSpecs::TestYourself.new([]) #empty argv + knife_command = KnifeSpecs::TestYourself.new([]) # empty argv knife_command.configure_chef expect(knife_command.config[:opt_with_default]).to eq("default-value") end it "prefers a value in Chef::Config[:knife] to the default" do Chef::Config[:knife][:opt_with_default] = "from-knife-config" - knife_command = KnifeSpecs::TestYourself.new([]) #empty argv + knife_command = KnifeSpecs::TestYourself.new([]) # empty argv knife_command.configure_chef expect(knife_command.config[:opt_with_default]).to eq("from-knife-config") end diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb index 3776372965..a7f95f8bfd 100644 --- a/spec/unit/lwrp_spec.rb +++ b/spec/unit/lwrp_spec.rb @@ -520,7 +520,7 @@ describe "LWRP" do resource.provider(get_dynamic_lwrp_provider(:lwrp_embedded_resource_accesses_providers_scope)) provider = resource.provider_for_action(:twiddle_thumbs) - #provider = @runner.build_provider(resource) + # provider = @runner.build_provider(resource) provider.action_twiddle_thumbs expect(provider.enclosed_resource.monkey).to eq("bob, the monkey") diff --git a/spec/unit/mixin/securable_spec.rb b/spec/unit/mixin/securable_spec.rb index 7ec39ac63f..de95aa2614 100644 --- a/spec/unit/mixin/securable_spec.rb +++ b/spec/unit/mixin/securable_spec.rb @@ -117,10 +117,10 @@ describe Chef::Mixin::Securable do it "should not accept group/owner names containing embedded carriage returns" do skip "XXX: params_validate needs to be extended to support multi-line regex" - #lambda { @securable.group "\ntest" }.should raise_error(ArgumentError) - #lambda { @securable.group "te\nst" }.should raise_error(ArgumentError) - #lambda { @securable.owner "\ntest" }.should raise_error(ArgumentError) - #lambda { @securable.owner "te\nst" }.should raise_error(ArgumentError) + # lambda { @securable.group "\ntest" }.should raise_error(ArgumentError) + # lambda { @securable.group "te\nst" }.should raise_error(ArgumentError) + # lambda { @securable.owner "\ntest" }.should raise_error(ArgumentError) + # lambda { @securable.owner "te\nst" }.should raise_error(ArgumentError) end it "should accept group/owner names in UTF-8" do diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index ee0f969f6d..0ca5f83adc 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -1282,8 +1282,8 @@ describe Chef::Node do end it "should serialize valid json with a run list", json: true do - #This test came about because activesupport mucks with Chef json serialization - #Test should pass with and without Activesupport + # This test came about because activesupport mucks with Chef json serialization + # Test should pass with and without Activesupport node.run_list << { "type" => "role", "name" => "Cthulu" } node.run_list << { "type" => "role", "name" => "Hastur" } json = Chef::JSONCompat.to_json(node) diff --git a/spec/unit/policy_builder/expand_node_object_spec.rb b/spec/unit/policy_builder/expand_node_object_spec.rb index 438e0805e7..122c960c11 100644 --- a/spec/unit/policy_builder/expand_node_object_spec.rb +++ b/spec/unit/policy_builder/expand_node_object_spec.rb @@ -48,7 +48,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do it "implements a setup_run_context method that accepts a list of recipe files to run" do expect(policy_builder).to respond_to(:setup_run_context) - expect(policy_builder.method(:setup_run_context).arity).to eq(-1) #optional argument + expect(policy_builder.method(:setup_run_context).arity).to eq(-1) # optional argument end it "implements a run_context method" do diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index 9baad64ea3..4a6266b58a 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -707,7 +707,7 @@ SHAS expect(@provider).to receive(:action_checkout) expect(@provider).not_to receive(:shell_out!).with("huzzah!", cwd: "/my/deploy/dir") @provider.run_action(:sync) - #@resource.should be_updated + # @resource.should be_updated end it "does an export by cloning the repo then removing the .git directory" do diff --git a/spec/unit/provider/link_spec.rb b/spec/unit/provider/link_spec.rb index 8f1ec8c3ba..027b318c7e 100644 --- a/spec/unit/provider/link_spec.rb +++ b/spec/unit/provider/link_spec.rb @@ -22,7 +22,7 @@ require "ostruct" require "spec_helper" if Chef::Platform.windows? - require "chef/win32/file" #probably need this in spec_helper + require "chef/win32/file" # probably need this in spec_helper end describe Chef::Resource::Link do diff --git a/spec/unit/provider/package/freebsd/pkg_spec.rb b/spec/unit/provider/package/freebsd/pkg_spec.rb index 6ad6813503..8c3e25a0f9 100644 --- a/spec/unit/provider/package/freebsd/pkg_spec.rb +++ b/spec/unit/provider/package/freebsd/pkg_spec.rb @@ -66,15 +66,15 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do describe "when querying for package state and attributes" do before do - #@new_resource = Chef::Resource::Package.new("zsh") + # @new_resource = Chef::Resource::Package.new("zsh") - #@provider = Chef::Provider::Package::Freebsd::Pkg.new(@node, @new_resource) + # @provider = Chef::Provider::Package::Freebsd::Pkg.new(@node, @new_resource) - #@status = double("Status", :exitstatus => 0) - #@stdin = double("STDIN", :null_object => true) - #@stdout = double("STDOUT", :null_object => true) - #@stderr = double("STDERR", :null_object => true) - #@pid = double("PID", :null_object => true) + # @status = double("Status", :exitstatus => 0) + # @stdin = double("STDIN", :null_object => true) + # @stdout = double("STDOUT", :null_object => true) + # @stderr = double("STDERR", :null_object => true) + # @pid = double("PID", :null_object => true) end it "should return the version number when it is installed" do @@ -111,7 +111,7 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do allow(@provider).to receive(:port_path).and_return("/usr/ports/shells/zsh") make_v = OpenStruct.new(stdout: "zsh-4.3.6_7\n", exitstatus: 0) expect(@provider).to receive(:shell_out_compacted!).with("make", "-V", "PKGNAME", { cwd: "/usr/ports/shells/zsh", env: nil, returns: [0, 1], timeout: 900 }).and_return(make_v) - #@provider.should_receive(:ports_makefile_variable_value).with("PKGNAME").and_return("zsh-4.3.6_7") + # @provider.should_receive(:ports_makefile_variable_value).with("PKGNAME").and_return("zsh-4.3.6_7") expect(@provider.package_name).to eq("zsh") end end @@ -134,7 +134,7 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do describe Chef::Provider::Package::Freebsd::Pkg, "port path" do before do - #@node = Chef::Node.new + # @node = Chef::Node.new @new_resource = Chef::Resource::Package.new("zsh") @new_resource.cookbook_name = "adventureclub" @provider = Chef::Provider::Package::Freebsd::Pkg.new(@new_resource, @run_context) diff --git a/spec/unit/provider/remote_file/ftp_spec.rb b/spec/unit/provider/remote_file/ftp_spec.rb index b2fbb7300c..72bb910e66 100644 --- a/spec/unit/provider/remote_file/ftp_spec.rb +++ b/spec/unit/provider/remote_file/ftp_spec.rb @@ -108,7 +108,7 @@ describe Chef::Provider::RemoteFile::FTP do before do current_resource.checksum(current_resource_checksum) - #Chef::Provider::RemoteFile::CacheControlData.should_receive(:load_and_validate).with(uri, current_resource_checksum).and_return(cache_control_data) + # Chef::Provider::RemoteFile::CacheControlData.should_receive(:load_and_validate).with(uri, current_resource_checksum).and_return(cache_control_data) end it "should connect to the host from the uri on the default port 21" do diff --git a/spec/unit/provider/remote_file/sftp_spec.rb b/spec/unit/provider/remote_file/sftp_spec.rb index d8fff87dec..244440d5c3 100644 --- a/spec/unit/provider/remote_file/sftp_spec.rb +++ b/spec/unit/provider/remote_file/sftp_spec.rb @@ -19,7 +19,7 @@ require "spec_helper" describe Chef::Provider::RemoteFile::SFTP do - #built out dependencies + # built out dependencies let(:enclosing_directory) do canonicalize_path(File.expand_path(File.join(CHEF_SPEC_DATA, "templates"))) end diff --git a/spec/unit/provider/service/aixinit_service_spec.rb b/spec/unit/provider/service/aixinit_service_spec.rb index 725d6e210c..6a586a0240 100644 --- a/spec/unit/provider/service/aixinit_service_spec.rb +++ b/spec/unit/provider/service/aixinit_service_spec.rb @@ -209,7 +209,7 @@ describe Chef::Provider::Service::AixInit do before do @files = ["/etc/rc.d/rc2.d/S20apache", "/etc/rc.d/rc2.d/K80apache"] # FIXME: this is clearly buggy the duplicated keys do not work - #@priority = {2 => [:start, 20], 2 => [:stop, 80]} + # @priority = {2 => [:start, 20], 2 => [:stop, 80]} @priority = { 2 => [:stop, 80] } allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]chef"]).and_return(@files) @@ -256,7 +256,7 @@ describe Chef::Provider::Service::AixInit do before do files = ["/etc/rc.d/rc2.d/Sapache", "/etc/rc.d/rc2.d/Kapache"] # FIXME: this is clearly buggy the duplicated keys do not work - #@priority = {2 => [:start, ''], 2 => [:stop, '']} + # @priority = {2 => [:start, ''], 2 => [:stop, '']} @priority = { 2 => [:stop, ""] } allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).and_return(files) diff --git a/spec/unit/provider/service/upstart_service_spec.rb b/spec/unit/provider/service/upstart_service_spec.rb index ae94e49835..365201cb38 100644 --- a/spec/unit/provider/service/upstart_service_spec.rb +++ b/spec/unit/provider/service/upstart_service_spec.rb @@ -43,7 +43,7 @@ describe Chef::Provider::Service::Upstart do it "should return /etc/event.d as the upstart job directory when running on Ubuntu 9.04" do @node.automatic_attrs[:platform_version] = "9.04" - #Chef::Platform.stub(:find_platform_and_version).and_return([ "ubuntu", "9.04" ]) + # Chef::Platform.stub(:find_platform_and_version).and_return([ "ubuntu", "9.04" ]) @provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context) expect(@provider.instance_variable_get(:@upstart_job_dir)).to eq("/etc/event.d") expect(@provider.instance_variable_get(:@upstart_conf_suffix)).to eq("") diff --git a/spec/unit/provider/windows_env_spec.rb b/spec/unit/provider/windows_env_spec.rb index a42a0509c5..0e6cb02d48 100644 --- a/spec/unit/provider/windows_env_spec.rb +++ b/spec/unit/provider/windows_env_spec.rb @@ -36,8 +36,8 @@ describe Chef::Provider::WindowsEnv, :windows_only do describe "when loading the current status" do before do - #@current_resource = @new_resource.clone - #Chef::Resource::Env.stub(:new).and_return(@current_resource) + # @current_resource = @new_resource.clone + # Chef::Resource::Env.stub(:new).and_return(@current_resource) @provider.current_resource = @current_resource allow(@provider).to receive(:env_value).with("FOO").and_return("bar") allow(@provider).to receive(:env_key_exists).and_return(true) diff --git a/spec/unit/provider/windows_task_spec.rb b/spec/unit/provider/windows_task_spec.rb index 39f39b37fe..f69ba49547 100644 --- a/spec/unit/provider/windows_task_spec.rb +++ b/spec/unit/provider/windows_task_spec.rb @@ -286,7 +286,7 @@ describe Chef::Provider::WindowsTask, :windows_only do end end - #Ref : https://msdn.microsoft.com/en-us/library/windows/desktop/aa380729(v=vs.85).aspx + # Ref : https://msdn.microsoft.com/en-us/library/windows/desktop/aa380729(v=vs.85).aspx describe "#days_of_week" do it "returns the binary value 2 if day is set as 'Mon'" do new_resource.day "Mon" diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb index 66b53b2f4a..cb03141c76 100644 --- a/spec/unit/provider_resolver_spec.rb +++ b/spec/unit/provider_resolver_spec.rb @@ -27,7 +27,7 @@ require "fileutils" include Chef::Mixin::ConvertToClassName # Open up Provider so we can write things down easier in here -#module Chef::Provider +# module Chef::Provider describe Chef::ProviderResolver do include IntegrationSupport @@ -428,7 +428,7 @@ describe Chef::ProviderResolver do # old debian uses the Debian provider (does not have insserv or upstart, or update-rc.d???) on_platform "debian", platform_version: "4.0", os: "linux" do - #it_behaves_like "a debian platform using the debian provider" + # it_behaves_like "a debian platform using the debian provider" end # Debian replaced the debian provider with insserv in the FIXME:VERSION distro diff --git a/spec/unit/resource/cookbook_file_spec.rb b/spec/unit/resource/cookbook_file_spec.rb index c670d2f543..b35233649d 100644 --- a/spec/unit/resource/cookbook_file_spec.rb +++ b/spec/unit/resource/cookbook_file_spec.rb @@ -2,7 +2,7 @@ # Author:: Daniel DeLeo (<dan@chef.io>) # Author:: Tyler Cloke (<tyler@chef.io>) # Copyright:: Copyright 2010-2017, Chef Software Inc. -#p License:: Apache License, Version 2.0 +# p 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. diff --git a/spec/unit/resource/powershell_package_spec.rb b/spec/unit/resource/powershell_package_spec.rb index 33c652f1d7..d82121a97b 100644 --- a/spec/unit/resource/powershell_package_spec.rb +++ b/spec/unit/resource/powershell_package_spec.rb @@ -26,7 +26,7 @@ describe Chef::Resource::PowershellPackage do expect(resource).to be_a_kind_of(Chef::Resource::Package) end - #to check the value of resource.resource_name + # to check the value of resource.resource_name it "has a resource name of :powershell_package" do expect(resource.resource_name).to eql(:powershell_package) end diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 92429e3257..a4f64e11e1 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -675,7 +675,7 @@ describe Chef::Resource do snitch_variable = nil resource.only_if { snitch_variable = true } expect(resource.only_if.first.positivity).to eq(:only_if) - #Chef::Mixin::Command.should_receive(:only_if).with(true, {}).and_return(false) + # Chef::Mixin::Command.should_receive(:only_if).with(true, {}).and_return(false) resource.run_action(:purr) expect(snitch_variable).to be_truthy end diff --git a/spec/unit/role_spec.rb b/spec/unit/role_spec.rb index b1400ae4f3..8e73ad347d 100644 --- a/spec/unit/role_spec.rb +++ b/spec/unit/role_spec.rb @@ -189,8 +189,8 @@ describe Chef::Role do end it "should include 'run_list'" do - #Activesupport messes with Chef json formatting - #This test should pass with and without activesupport + # Activesupport messes with Chef json formatting + # This test should pass with and without activesupport expect(@serialized_role).to match(/"run_list":\["recipe\[one\]","recipe\[two\]","role\[a\]"\]/) end @@ -201,8 +201,8 @@ describe Chef::Role do end it "includes the per-environment run lists" do - #Activesupport messes with Chef json formatting - #This test should pass with and without activesupport + # Activesupport messes with Chef json formatting + # This test should pass with and without activesupport expect(@serialized_role["env_run_lists"]["production"]).to eq(["role[monitoring]", "role[auditing]", "role[apache]"]) expect(@serialized_role["env_run_lists"]["dev"]).to eq(["role[nginx]"]) end diff --git a/spec/unit/run_list_spec.rb b/spec/unit/run_list_spec.rb index 6117a89ca7..ac062c665d 100644 --- a/spec/unit/run_list_spec.rb +++ b/spec/unit/run_list_spec.rb @@ -197,7 +197,7 @@ describe Chef::RunList do describe "from the chef server" do it "should load the role from the chef server" do - #@rest.should_receive(:get).with("roles/stubby") + # @rest.should_receive(:get).with("roles/stubby") expansion = @run_list.expand("_default", "server") expect(expansion.recipes).to eq(%w{one two kitty}) end diff --git a/spec/unit/shell/shell_session_spec.rb b/spec/unit/shell/shell_session_spec.rb index c4cb7c6815..ce66676196 100644 --- a/spec/unit/shell/shell_session_spec.rb +++ b/spec/unit/shell/shell_session_spec.rb @@ -214,7 +214,7 @@ describe Shell::SoloLegacySession do it "keeps json attribs and passes them to the node for consumption" do @session.node_attributes = { "besnard_lakes" => "are_the_dark_horse" } expect(@session.node["besnard_lakes"]).to eq("are_the_dark_horse") - #pending "1) keep attribs in an ivar 2) pass them to the node 3) feed them to the node on reset" + # pending "1) keep attribs in an ivar 2) pass them to the node 3) feed them to the node on reset" end it "generates its resource collection from the compiled cookbooks and the ad hoc recipe" do @@ -223,7 +223,7 @@ describe Shell::SoloLegacySession do @run_context.resource_collection << kitteh_cat keyboard_cat = Chef::Resource::Cat.new("keyboard_cat") @recipe.run_context.resource_collection << keyboard_cat - #@session.rebuild_collection + # @session.rebuild_collection expect(@session.resource_collection).to include(kitteh_cat, keyboard_cat) end diff --git a/spec/unit/win32/registry_spec.rb b/spec/unit/win32/registry_spec.rb index c880c8922a..574f38d8e2 100644 --- a/spec/unit/win32/registry_spec.rb +++ b/spec/unit/win32/registry_spec.rb @@ -41,7 +41,7 @@ describe Chef::Win32::Registry do before(:each) do allow_any_instance_of(Chef::Win32::Registry).to receive(:machine_architecture).and_return(:x86_64) - #Making the values for registry constants available on unix + # Making the values for registry constants available on unix Win32::Registry::KEY_SET_VALUE = 0x0002 Win32::Registry::KEY_QUERY_VALUE = 0x0001 Win32::Registry::KEY_WRITE = 0x00020000 | 0x0002 | 0x0004 |