summaryrefslogtreecommitdiff
path: root/lib/chef/util
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-09 07:53:56 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-09 07:53:56 -0800
commitf073747786abbe6ada55ed24b696a03e39c3c45d (patch)
tree7971d871e89d522a58291713761a6c83f68e8d19 /lib/chef/util
parentc6e69783705cfd48bfea0c943dc071964dd21311 (diff)
downloadchef-f073747786abbe6ada55ed24b696a03e39c3c45d.tar.gz
auto fixing some rubocops
Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
Diffstat (limited to 'lib/chef/util')
-rw-r--r--lib/chef/util/dsc/local_configuration_manager.rb10
-rw-r--r--lib/chef/util/windows/net_group.rb12
-rw-r--r--lib/chef/util/windows/net_user.rb12
3 files changed, 17 insertions, 17 deletions
diff --git a/lib/chef/util/dsc/local_configuration_manager.rb b/lib/chef/util/dsc/local_configuration_manager.rb
index 3b4eaa92a9..741c6a5898 100644
--- a/lib/chef/util/dsc/local_configuration_manager.rb
+++ b/lib/chef/util/dsc/local_configuration_manager.rb
@@ -81,11 +81,11 @@ EOH
def log_what_if_exception(what_if_exception_output)
if whatif_not_supported?(what_if_exception_output)
# LCM returns an error if any of the resources do not support the opptional What-If
- Chef::Log::warn("Received error while testing configuration due to resource not supporting 'WhatIf'")
+ Chef::Log.warn("Received error while testing configuration due to resource not supporting 'WhatIf'")
elsif dsc_module_import_failure?(what_if_exception_output)
- Chef::Log::warn("Received error while testing configuration due to a module for an imported resource possibly not being fully installed:\n#{what_if_exception_output.gsub(/\s+/, ' ')}")
+ Chef::Log.warn("Received error while testing configuration due to a module for an imported resource possibly not being fully installed:\n#{what_if_exception_output.gsub(/\s+/, ' ')}")
else
- Chef::Log::warn("Received error while testing configuration:\n#{what_if_exception_output.gsub(/\s+/, ' ')}")
+ Chef::Log.warn("Received error while testing configuration:\n#{what_if_exception_output.gsub(/\s+/, ' ')}")
end
end
@@ -102,9 +102,9 @@ EOH
def configuration_update_required?(what_if_output)
Chef::Log.debug("DSC: DSC returned the following '-whatif' output from test operation:\n#{what_if_output}")
begin
- Parser::parse(what_if_output)
+ Parser.parse(what_if_output)
rescue Chef::Exceptions::LCMParser => e
- Chef::Log::warn("Could not parse LCM output: #{e}")
+ Chef::Log.warn("Could not parse LCM output: #{e}")
[Chef::Util::DSC::ResourceInfo.new("Unknown DSC Resources", true, ["Unknown changes because LCM output was not parsable."])]
end
end
diff --git a/lib/chef/util/windows/net_group.rb b/lib/chef/util/windows/net_group.rb
index 6dd6e39f2b..0a351fbc6f 100644
--- a/lib/chef/util/windows/net_group.rb
+++ b/lib/chef/util/windows/net_group.rb
@@ -36,7 +36,7 @@ class Chef::Util::Windows::NetGroup
def local_get_members
begin
- Chef::ReservedNames::Win32::NetUser::net_local_group_get_members(nil, groupname)
+ Chef::ReservedNames::Win32::NetUser.net_local_group_get_members(nil, groupname)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
@@ -44,7 +44,7 @@ class Chef::Util::Windows::NetGroup
def local_add
begin
- Chef::ReservedNames::Win32::NetUser::net_local_group_add(nil, groupname)
+ Chef::ReservedNames::Win32::NetUser.net_local_group_add(nil, groupname)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
@@ -52,7 +52,7 @@ class Chef::Util::Windows::NetGroup
def local_set_members(members)
begin
- Chef::ReservedNames::Win32::NetUser::net_local_group_set_members(nil, groupname, members)
+ Chef::ReservedNames::Win32::NetUser.net_local_group_set_members(nil, groupname, members)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
@@ -60,7 +60,7 @@ class Chef::Util::Windows::NetGroup
def local_add_members(members)
begin
- Chef::ReservedNames::Win32::NetUser::net_local_group_add_members(nil, groupname, members)
+ Chef::ReservedNames::Win32::NetUser.net_local_group_add_members(nil, groupname, members)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
@@ -68,7 +68,7 @@ class Chef::Util::Windows::NetGroup
def local_delete_members(members)
begin
- Chef::ReservedNames::Win32::NetUser::net_local_group_del_members(nil, groupname, members)
+ Chef::ReservedNames::Win32::NetUser.net_local_group_del_members(nil, groupname, members)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
@@ -76,7 +76,7 @@ class Chef::Util::Windows::NetGroup
def local_delete
begin
- Chef::ReservedNames::Win32::NetUser::net_local_group_del(nil, groupname)
+ Chef::ReservedNames::Win32::NetUser.net_local_group_del(nil, groupname)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
diff --git a/lib/chef/util/windows/net_user.rb b/lib/chef/util/windows/net_user.rb
index f2edeacf17..b0a779e44a 100644
--- a/lib/chef/util/windows/net_user.rb
+++ b/lib/chef/util/windows/net_user.rb
@@ -79,7 +79,7 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows
def set_info(args)
begin
- rc = NetUser::net_user_set_info_l3(nil, @username, transform_usri3(args))
+ rc = NetUser.net_user_set_info_l3(nil, @username, transform_usri3(args))
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
@@ -96,7 +96,7 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows
#XXX for an extra painful alternative, see: http://support.microsoft.com/kb/180548
def validate_credentials(passwd)
begin
- token = Security::logon_user(@username, nil, passwd,
+ token = Security.logon_user(@username, nil, passwd,
LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT)
return true
rescue Chef::Exceptions::Win32APIError
@@ -106,7 +106,7 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows
def get_info
begin
- ui3 = NetUser::net_user_get_info_l3(nil, @username)
+ ui3 = NetUser.net_user_get_info_l3(nil, @username)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end
@@ -115,8 +115,8 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows
def add(args)
transformed_args = transform_usri3(args)
- NetUser::net_user_add_l3(nil, transformed_args)
- NetUser::net_local_group_add_member(nil, "Users", args[:name])
+ NetUser.net_user_add_l3(nil, transformed_args)
+ NetUser.net_local_group_add_member(nil, "Users", args[:name])
end
def user_modify(&proc)
@@ -137,7 +137,7 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows
def delete
begin
- NetUser::net_user_del(nil, @username)
+ NetUser.net_user_del(nil, @username)
rescue Chef::Exceptions::Win32APIError => e
raise ArgumentError, e
end