Skip to content

Commit

Permalink
[CHEF-1767] move list of binaries to its own method for use by subcla…
Browse files Browse the repository at this point in the history
…sses
  • Loading branch information
dougm authored and danielsdeleo committed Mar 18, 2011
1 parent eac7c3a commit 02ea5c0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions chef/lib/chef/provider/group/groupadd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ class Provider
class Group
class Groupadd < Chef::Provider::Group

def load_current_resource
super

def required_binaries
[ "/usr/sbin/groupadd",
"/usr/sbin/groupmod",
"/usr/sbin/groupdel" ].each do |required_binary|
"/usr/sbin/groupdel" ]
end

def load_current_resource
super
required_binaries.each do |required_binary|
raise Chef::Exceptions::Group, "Could not find binary #{required_binary} for #{@new_resource}" unless ::File.exists?(required_binary)
end
end
Expand Down

0 comments on commit 02ea5c0

Please sign in to comment.