[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1601-gf8c1b08

James Turnbull james at lovedthanlost.net
Fri Jan 15 09:08:16 UTC 2010


The following commit has been merged in the upstream branch:
commit 24654a22c2d172b23cb1133f65da4e5a2801de0a
Author: Markus Roberts <Markus at reality.com>
Date:   Mon Dec 21 14:47:41 2009 -0800

    Making provider/host/parser.rb compatible with host_aliases
    
    When I changed the alias property of hosts to host_aliases I missed
    these changes in the parsed file provider.

diff --git a/lib/puppet/provider/host/parsed.rb b/lib/puppet/provider/host/parsed.rb
index e638138..56caf8b 100644
--- a/lib/puppet/provider/host/parsed.rb
+++ b/lib/puppet/provider/host/parsed.rb
@@ -17,8 +17,8 @@ Puppet::Type.type(:host).provide(:parsed,
     text_line :comment, :match => /^#/
     text_line :blank, :match => /^\s*$/
 
-    record_line :parsed, :fields => %w{ip name alias},
-        :optional => %w{alias},
+    record_line :parsed, :fields => %w{ip name host_aliases},
+        :optional => %w{host_aliases},
         :rts => true do |line|
         hash = {}
         if line.sub!(/^(\S+)\s+(\S+)\s*/, '')
@@ -30,7 +30,7 @@ Puppet::Type.type(:host).provide(:parsed,
                 line.sub!(/^([^#]+)\s*/) do |value|
                     aliases = $1
                     unless aliases =~ /^\s*$/
-                        hash[:alias] = aliases.split(/\s+/)
+                        hash[:host_aliases] = aliases.split(/\s+/)
                     end
 
                     ""
@@ -40,8 +40,8 @@ Puppet::Type.type(:host).provide(:parsed,
             raise Puppet::Error, "Could not match '%s'" % line
         end
 
-        if hash[:alias] == ""
-            hash.delete(:alias)
+        if hash[:host_aliases] == ""
+            hash.delete(:host_aliases)
         end
 
         return hash
@@ -58,11 +58,11 @@ Puppet::Type.type(:host).provide(:parsed,
 
         str = "%s\t%s" % [hash[:ip], hash[:name]]
 
-        if hash.include? :alias
+        if hash.include? :host_aliases
             if hash[:alias].is_a? Array
-                str += "\t%s" % hash[:alias].join("\t")
+                str += "\t%s" % hash[:host_aliases].join("\t")
             else
-                raise ArgumentError, "Aliases must be specified as an array"
+                raise ArgumentError, "Host aliases must be specified as an array"
             end
         end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list