From: Bryan Kearney <[email protected]>

Signed-off-by: James Turnbull <[email protected]>
---
 lib/puppet/provider/augeas/augeas.rb |    4 ++++
 lib/puppet/type/augeas.rb            |    1 +
 spec/unit/provider/augeas/augeas.rb  |   10 ++++++++++
 3 files changed, 15 insertions(+), 0 deletions(-)

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
-- 
1.6.6

-- 
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.

Reply via email to