[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 2ae7516d77c57c2c26c7afca1e8b825f307887c1
Author: Bryan Kearney <bkearney at redhat.com>
Date:   Mon Feb 1 12:24:01 2010 -0500

    2047: Add a not_include into match

diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
index 8dccb4e..ac11bbf 100644
--- a/lib/puppet/provider/augeas/augeas.rb
+++ b/lib/puppet/provider/augeas/augeas.rb
@@ -39,6 +39,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do
       "match" => [ :path, :glob ],
       "size" => [:comparator, :int],
       "include" => [:string],
+      "not_include" => [:string],
       "==" => [:glob],
       "!=" => [:glob]
     }
@@ -206,6 +207,9 @@ Puppet::Type.type(:augeas).provide(:augeas) do
         when "include"
             arg = clause_array.shift
             return_value = result.include?(arg)
+        when "not_include"
+            arg = clause_array.shift
+            return_value = !result.include?(arg)
         when "=="
             begin
                 arg = clause_array.shift
diff --git a/lib/puppet/type/augeas.rb b/lib/puppet/type/augeas.rb
index 4ae3f06..cfd1da5 100644
--- a/lib/puppet/type/augeas.rb
+++ b/lib/puppet/type/augeas.rb
@@ -71,6 +71,7 @@ Puppet::Type.newtype(:augeas) do
                get [AUGEAS_PATH] [COMPARATOR] [STRING]
                match [MATCH_PATH] size [COMPARATOR] [INT]
                match [MATCH_PATH] include [STRING]
+               match [MATCH_PATH] not_include [STRING]
                match [MATCH_PATH] == [AN_ARRAY]
                match [MATCH_PATH] != [AN_ARRAY]
 
diff --git a/spec/unit/provider/augeas/augeas.rb b/spec/unit/provider/augeas/augeas.rb
index 3b9bd2c..89d3f50 100644
--- a/spec/unit/provider/augeas/augeas.rb
+++ b/spec/unit/provider/augeas/augeas.rb
@@ -204,6 +204,16 @@ describe provider_class do
             @provider.process_match(command).should == false
         end
 
+        it "should return true for includes match" do
+            command = ["match", "fake value", "not_include JarJar"]
+            @provider.process_match(command).should == true
+        end
+
+        it "should return false for includes non match" do
+            command = ["match", "fake value", "not_include values"]
+            @provider.process_match(command).should == false
+        end
+
         it "should return true for an array match" do
             command = ["match", "fake value", "== ['set', 'of', 'values']"]
             @provider.process_match(command).should == true

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list