diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-01-07 16:35:41 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2010-01-12 10:32:45 +1100 |
commit | 7f258059d8c16c2a20f48a28d636227cdb5a346b (patch) | |
tree | e990eb54322430d55c5d81964c661384c99c522f /spec/unit/provider | |
parent | c99f394bf8c10d13f3fa7d3ab7ab43ecf454c081 (diff) | |
download | puppet-7f258059d8c16c2a20f48a28d636227cdb5a346b.tar.gz puppet-7f258059d8c16c2a20f48a28d636227cdb5a346b.tar.xz puppet-7f258059d8c16c2a20f48a28d636227cdb5a346b.zip |
Fix #1464 Mount complains about missing fields
This family of errors could appear because Puppet parses every line in
fstab into resources, even lines that are not specifically managed by
Puppet, and fstab files are much more permissive than Puppet in what
constitutes a valid mount.
This change makes several fields optional that were previously mandatory.
Also, it ignores lines in fstab that have fewer than the required number
of parameters.
Includes a more readable regex than the previous patch.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'spec/unit/provider')
-rwxr-xr-x | spec/unit/provider/mount/parsed.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/provider/mount/parsed.rb b/spec/unit/provider/mount/parsed.rb index 10329e404..d394b2997 100755 --- a/spec/unit/provider/mount/parsed.rb +++ b/spec/unit/provider/mount/parsed.rb @@ -108,6 +108,15 @@ describe provider_class do end Puppet::Type.type(:mount).provider(:parsed).default_target.should == should end + + it "should not crash on incomplete lines in fstab" do + parse = @provider_class.parse <<-FSTAB +/dev/incomplete +/dev/device name + FSTAB + + lambda{ @provider_class.to_line(parse[0]) }.should_not raise_error + end end describe provider_class, " when mounting an absent filesystem" do |