[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Hector Rivas Gandara keymon at gmail.com
Tue May 10 08:03:50 UTC 2011


The following commit has been merged in the experimental branch:
commit d65e094c05739324b14a921152092e080aa32b4e
Author: Hector Rivas Gandara <keymon at gmail.com>
Date:   Mon Dec 27 14:20:24 2010 +0100

    (#5432) Use AIX native commands to manage users and groups
    
    Fixed providers for new aixobject.rb
    Fixed incorrect variable naming.

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 })

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list