---
 lib/puppet/provider/augeas/augeas.rb |    2 ++
 spec/unit/provider/augeas/augeas.rb  |   13 +++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/provider/augeas/augeas.rb 
b/lib/puppet/provider/augeas/augeas.rb
index 0c73b79..a645fbe 100644
--- a/lib/puppet/provider/augeas/augeas.rb
+++ b/lib/puppet/provider/augeas/augeas.rb
@@ -66,6 +66,8 @@ Puppet::Type.type(:augeas).provide(:augeas) do
         end
         args = []
         data.each do |line|
+            line.strip!
+            next if line.nil? || line.empty?
             argline = []
             sc = StringScanner.new(line)
             cmd = sc.scan(/\w+|==|!=/)
diff --git a/spec/unit/provider/augeas/augeas.rb 
b/spec/unit/provider/augeas/augeas.rb
index 1ba6146..3b9bd2c 100644
--- a/spec/unit/provider/augeas/augeas.rb
+++ b/spec/unit/provider/augeas/augeas.rb
@@ -35,6 +35,19 @@ describe provider_class do
             tokens[1][1].should == "anakin"
         end
 
+        it "should strip whitespace and ignore blank lines" do
+            @resource.stubs(:[]).returns("")
+            tokens = @provider.parse_commands("  set /Jar/Jar Binks \t\n  \n\n 
 rm anakin ")
+            tokens.size.should == 2
+            tokens[0].size.should == 3
+            tokens[1].size.should == 2
+            tokens[0][0].should == "set"
+            tokens[0][1].should == "/Jar/Jar"
+            tokens[0][2].should == "Binks"
+            tokens[1][0].should == "rm"
+            tokens[1][1].should == "anakin"
+        end
+
         it "should handle arrays" do
             @resource.stubs(:[]).returns("/foo/")
             commands = ["set /Jar/Jar Binks", "rm anakin"]
-- 
1.6.0.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