summaryrefslogtreecommitdiff
path: root/lib/chef/provider/group
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-31 09:57:05 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-31 09:57:05 -0700
commit14b9553818265ecc35c037adfe479320e3a70e34 (patch)
treeec8f36c6f929f0c0b56f062484a280d6e645d61e /lib/chef/provider/group
parentf051b6e7912086edc03747f4b1c0285bfb6597f5 (diff)
downloadchef-lcg/weirich-semantic-block.tar.gz
For Discussion: Weirich Semantic Block stylelcg/weirich-semantic-block
Style/BlockDelimiters: Enabled: true EnforcedStyle: semantic See, eg: https://github.com/rubocop-hq/ruby-style-guide/issues/162 http://www.virtuouscode.com/2011/07/26/the-procedurefunction-block-convention-in-ruby/ Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider/group')
-rw-r--r--lib/chef/provider/group/dscl.rb6
-rw-r--r--lib/chef/provider/group/gpasswd.rb2
-rw-r--r--lib/chef/provider/group/groupadd.rb2
-rw-r--r--lib/chef/provider/group/pw.rb2
-rw-r--r--lib/chef/provider/group/solaris.rb2
-rw-r--r--lib/chef/provider/group/suse.rb4
-rw-r--r--lib/chef/provider/group/usermod.rb6
7 files changed, 12 insertions, 12 deletions
diff --git a/lib/chef/provider/group/dscl.rb b/lib/chef/provider/group/dscl.rb
index decad69e40..d8370ff57e 100644
--- a/lib/chef/provider/group/dscl.rb
+++ b/lib/chef/provider/group/dscl.rb
@@ -30,8 +30,8 @@ class Chef
status = shell_out(shellcmd)
stdout_result = ""
stderr_result = ""
- status.stdout.each_line { |line| stdout_result << line }
- status.stderr.each_line { |line| stderr_result << line }
+ status.stdout.each_line do |line| stdout_result << line end
+ status.stderr.each_line do |line| stderr_result << line end
[shellcmd.flatten.compact.join(" "), status, stdout_result, stderr_result]
end
@@ -142,7 +142,7 @@ class Chef
def define_resource_requirements
super
requirements.assert(:all_actions) do |a|
- a.assertion { ::File.exist?("/usr/bin/dscl") }
+ a.assertion do ::File.exist?("/usr/bin/dscl") end
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/bin/dscl for #{new_resource.name}"
# No whyrun alternative: this component should be available in the base install of any given system that uses it
end
diff --git a/lib/chef/provider/group/gpasswd.rb b/lib/chef/provider/group/gpasswd.rb
index 5d769befa4..6eaf4cc991 100644
--- a/lib/chef/provider/group/gpasswd.rb
+++ b/lib/chef/provider/group/gpasswd.rb
@@ -31,7 +31,7 @@ class Chef
def define_resource_requirements
super
requirements.assert(:all_actions) do |a|
- a.assertion { ::File.exist?("/usr/bin/gpasswd") }
+ a.assertion do ::File.exist?("/usr/bin/gpasswd") end
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/bin/gpasswd for #{new_resource}"
# No whyrun alternative: this component should be available in the base install of any given system that uses it
end
diff --git a/lib/chef/provider/group/groupadd.rb b/lib/chef/provider/group/groupadd.rb
index eca104b565..9671ec35de 100644
--- a/lib/chef/provider/group/groupadd.rb
+++ b/lib/chef/provider/group/groupadd.rb
@@ -35,7 +35,7 @@ class Chef
super
required_binaries.each do |required_binary|
requirements.assert(:all_actions) do |a|
- a.assertion { ::File.exist?(required_binary) }
+ a.assertion do ::File.exist?(required_binary) end
a.failure_message Chef::Exceptions::Group, "Could not find binary #{required_binary} for #{new_resource}"
# No whyrun alternative: this component should be available in the base install of any given system that uses it
end
diff --git a/lib/chef/provider/group/pw.rb b/lib/chef/provider/group/pw.rb
index c018de8d4d..ecad8f44ba 100644
--- a/lib/chef/provider/group/pw.rb
+++ b/lib/chef/provider/group/pw.rb
@@ -30,7 +30,7 @@ class Chef
super
requirements.assert(:all_actions) do |a|
- a.assertion { ::File.exist?("/usr/sbin/pw") }
+ a.assertion do ::File.exist?("/usr/sbin/pw") end
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/pw for #{new_resource}"
# No whyrun alternative: this component should be available in the base install of any given system that uses it
end
diff --git a/lib/chef/provider/group/solaris.rb b/lib/chef/provider/group/solaris.rb
index 75768297db..fe33f06917 100644
--- a/lib/chef/provider/group/solaris.rb
+++ b/lib/chef/provider/group/solaris.rb
@@ -35,7 +35,7 @@ class Chef
super
requirements.assert(:all_actions) do |a|
- a.assertion { ::File.exist?("/usr/sbin/usermod") && ::File.exist?("/usr/sbin/groupmod") }
+ a.assertion do ::File.exist?("/usr/sbin/usermod") && ::File.exist?("/usr/sbin/groupmod") end
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/usermod or /usr/sbin/groupmod for #{new_resource}"
# No whyrun alternative: this component should be available in the base install of any given system that uses it
end
diff --git a/lib/chef/provider/group/suse.rb b/lib/chef/provider/group/suse.rb
index 7bd9700a15..76026eea51 100644
--- a/lib/chef/provider/group/suse.rb
+++ b/lib/chef/provider/group/suse.rb
@@ -32,7 +32,7 @@ class Chef
def define_resource_requirements
super
requirements.assert(:all_actions) do |a|
- a.assertion { ::File.exist?("/usr/sbin/groupmod") }
+ a.assertion do ::File.exist?("/usr/sbin/groupmod") end
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/groupmod for #{new_resource.name}"
# No whyrun alternative: this component should be available in the base install of any given system that uses it
end
@@ -40,7 +40,7 @@ class Chef
requirements.assert(:create, :manage, :modify) do |a|
a.assertion do
begin
- to_add(new_resource.members).all? { |member| Etc.getpwnam(member) }
+ to_add(new_resource.members).all? do |member| Etc.getpwnam(member) end
rescue
false
end
diff --git a/lib/chef/provider/group/usermod.rb b/lib/chef/provider/group/usermod.rb
index b4e93580ff..9f414d7feb 100644
--- a/lib/chef/provider/group/usermod.rb
+++ b/lib/chef/provider/group/usermod.rb
@@ -33,19 +33,19 @@ class Chef
super
requirements.assert(:all_actions) do |a|
- a.assertion { ::File.exist?("/usr/sbin/usermod") }
+ a.assertion do ::File.exist?("/usr/sbin/usermod") end
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/usermod for #{new_resource}"
# No whyrun alternative: this component should be available in the base install of any given system that uses it
end
requirements.assert(:modify, :manage) do |a|
- a.assertion { new_resource.members.empty? || new_resource.append }
+ a.assertion do new_resource.members.empty? || new_resource.append end
a.failure_message Chef::Exceptions::Group, "setting group members directly is not supported by #{self}, must set append true in group"
# No whyrun alternative - this action is simply not supported.
end
requirements.assert(:all_actions) do |a|
- a.assertion { new_resource.excluded_members.empty? }
+ a.assertion do new_resource.excluded_members.empty? end
a.failure_message Chef::Exceptions::Group, "excluded_members is not supported by #{self}"
# No whyrun alternative - this action is simply not supported.
end