Fixed providers for new aixobject.rb
Fixed incorrect variable naming.
Signed-off-by: Hector Rivas Gandara <[email protected]>
---
Local-branch: feature/master/5432
lib/puppet/provider/aixobject.rb | 8 ++++----
lib/puppet/provider/group/aix.rb | 8 ++++++--
lib/puppet/provider/user/aix.rb | 10 +++++-----
3 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/lib/puppet/provider/aixobject.rb b/lib/puppet/provider/aixobject.rb
index ae5180d..d98e36b 100755
--- a/lib/puppet/provider/aixobject.rb
+++ b/lib/puppet/provider/aixobject.rb
@@ -146,13 +146,13 @@ class Puppet::Provider::AixObject < Puppet::Provider
end
# convert it to string
- if new_val.is_a? Array
- new_val = new_val.join(",")
+ if new_value.is_a? Array
+ new_value = new_value.join(",")
else
- new_val = new_val.to_s
+ new_value = new_value.to_s
end
- if new_key?
+ if new_key
return [ "#{new_key}=#{new_value}" ]
else
return []
diff --git a/lib/puppet/provider/group/aix.rb b/lib/puppet/provider/group/aix.rb
index 0c3122b..6ae16b5 100755
--- a/lib/puppet/provider/group/aix.rb
+++ b/lib/puppet/provider/group/aix.rb
@@ -49,19 +49,23 @@ Puppet::Type.type(:group).provide :aix, :parent =>
Puppet::Provider::AixObject d
[self.class.command(:list), "-R", self.class.ia_module , value]
end
+ def lsallcmd()
+ lscmd("ALL")
+ end
+
def addcmd(extra_attrs = [])
# Here we use the @resource.to_hash to get the list of provided parameters
# Puppet does not call to self.<parameter>= method if it does not exists.
#
# It gets an extra list of arguments to add to the user.
[self.class.command(:add), "-R", self.class.ia_module ]+
- self.class.hash2attr(@resource.to_hash) +
+ self.hash2args(@resource.to_hash) +
extra_attrs + [...@resource[:name]]
end
def modifycmd(hash = property_hash)
[self.class.command(:modify), "-R", self.class.ia_module ]+
- self.class.hash2attr(hash) + [...@resource[:name]]
+ self.hash2args(hash) + [...@resource[:name]]
end
def deletecmd
diff --git a/lib/puppet/provider/user/aix.rb b/lib/puppet/provider/user/aix.rb
index 4a5c4ee..06dfd52 100755
--- a/lib/puppet/provider/user/aix.rb
+++ b/lib/puppet/provider/user/aix.rb
@@ -97,13 +97,13 @@ Puppet::Type.type(:user).provide :aix, :parent =>
Puppet::Provider::AixObject do
#
# It gets an extra list of arguments to add to the user.
[self.class.command(:add), "-R", self.class.ia_module ]+
- self.class.hash2attr(@resource.to_hash) +
+ self.hash2args(@resource.to_hash) +
extra_attrs + [...@resource[:name]]
end
def modifycmd(hash = property_hash)
[self.class.command(:modify), "-R", self.class.ia_module ]+
- self.class.hash2attr(hash) + [...@resource[:name]]
+ self.hash2args(hash) + [...@resource[:name]]
end
def deletecmd
@@ -123,7 +123,7 @@ Puppet::Type.type(:user).provide :aix, :parent =>
Puppet::Provider::AixObject do
def self.groupname_by_id(gid)
groupname=nil
execute(lsgroupscmd("ALL")).each { |entry|
- attrs = parse_attr_list(entry, nil)
+ attrs = self.parse_attr_list(entry, nil)
if attrs and attrs.include? :id and gid == attrs[:id].to_i
groupname = entry.split(" ")[0]
end
@@ -133,7 +133,7 @@ Puppet::Type.type(:user).provide :aix, :parent =>
Puppet::Provider::AixObject do
# Get the groupname from its id
def groupid_by_name(groupname)
- attrs = parse_attr_list(execute(lsgroupscmd(groupname)).split("\n")[0],
nil)
+ attrs =
self.parse_attr_list(execute(lsgroupscmd(groupname)).split("\n")[0], nil)
attrs ? attrs[:id].to_i : nil
end
@@ -228,7 +228,7 @@ Puppet::Type.type(:user).provide :aix, :parent =>
Puppet::Provider::AixObject do
# Options '-e', '-c', use encrypted password and clear flags
# Must receibe "user:enc_password" as input
# command, arguments = {:failonfail => true, :combine => true}
- cmd = [self.class.command(:chpasswd),"-R", ia_module,
+ cmd = [self.class.command(:chpasswd),"-R", self.class.ia_module,
'-e', '-c', user]
begin
execute(cmd, {:failonfail => true, :combine => true, :stdinfile =>
tmpfile.path })
--
1.7.1
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.