[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.4-89-gcbbd363

Bryan Kearney bkearney at redhat.com
Tue May 18 09:03:35 UTC 2010


The following commit has been merged in the upstream branch:
commit 8a3a2056c82c7d0313a052fef00d3a8f039fe0db
Author: Bryan Kearney <bkearney at redhat.com>
Date:   Mon Feb 1 15:02:24 2010 -0500

    Fix for #2327, check the return types from augeas and fail where appropriate

diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
index ac11bbf..d586fc1 100644
--- a/lib/puppet/provider/augeas/augeas.rb
+++ b/lib/puppet/provider/augeas/augeas.rb
@@ -197,6 +197,8 @@ Puppet::Type.type(:augeas).provide(:augeas) do
 
         #Get the values from augeas
         result = @aug.match(path) || []
+        fail("Error trying to match path '#{path}'") if (result == -1)
+
         # Now do the work
         case verb
         when "size"
@@ -321,13 +323,16 @@ Puppet::Type.type(:augeas).provide(:augeas) do
                 case command
                     when "set"
                         debug("sending command '#{command}' with params #{cmd_array.inspect}")
-                        aug.set(cmd_array[0], cmd_array[1])
+                        rv = aug.set(cmd_array[0], cmd_array[1])
+                        fail("Error sending command '#{command}' with params #{cmd_array.inspect}/#{e.message}") if (rv)
                     when "rm", "remove"
                         debug("sending command '#{command}' with params #{cmd_array.inspect}")
-                        aug.rm(cmd_array[0])
+                        rv = aug.rm(cmd_array[0])
+                        fail("Error sending command '#{command}' with params #{cmd_array.inspect}/#{e.message}") if (rv)
                     when "clear"
                         debug("sending command '#{command}' with params #{cmd_array.inspect}")
-                        @aug.clear(cmd_array[0])
+                        rv = aug.clear(cmd_array[0])
+                        fail("Error sending command '#{command}' with params #{cmd_array.inspect}/#{e.message}") if (rv == -1)
                     when "insert", "ins"
                         label = cmd_array[0]
                         where = cmd_array[1]
@@ -338,7 +343,8 @@ Puppet::Type.type(:augeas).provide(:augeas) do
                             else fail("Invalid value '#{where}' for where param")
                         end
                         debug("sending command '#{command}' with params #{[label, where, path].inspect}")
-                        aug.insert(path, label, before)
+                        rv = aug.insert(path, label, before)
+                        fail("Error sending command '#{command}' with params #{cmd_array.inspect}/#{e.message}") if (rv == -1)
                     else fail("Command '#{command}' is not supported")
                 end
             rescue SystemExit,NoMemoryError

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list