diff options
| author | Francois Deppierraz <francois.deppierraz@camptocamp.com> | 2009-05-08 19:52:04 +0200 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-05-15 09:54:34 +1000 |
| commit | 172422fc0422e2646c4cc3afb7955876651cbf3e (patch) | |
| tree | 614179023a72781a8511b44c22481828ebc3ca3e | |
| parent | f945b66aee03c0c06248f3809773f444a25ff00f (diff) | |
Fix bug #2124 - ssh_authorized_key always changes target if target is not defined
| -rw-r--r-- | lib/puppet/type/ssh_authorized_key.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/type/ssh_authorized_key.rb | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/puppet/type/ssh_authorized_key.rb b/lib/puppet/type/ssh_authorized_key.rb index 33ed1d62b..a16746ac4 100644 --- a/lib/puppet/type/ssh_authorized_key.rb +++ b/lib/puppet/type/ssh_authorized_key.rb @@ -48,6 +48,10 @@ module Puppet return nil end end + + def insync?(is) + is == should + end end newproperty(:options, :array_matching => :all) do diff --git a/spec/unit/type/ssh_authorized_key.rb b/spec/unit/type/ssh_authorized_key.rb index f1e9963e9..926da3c62 100755 --- a/spec/unit/type/ssh_authorized_key.rb +++ b/spec/unit/type/ssh_authorized_key.rb @@ -120,7 +120,14 @@ describe ssh_authorized_key do target = File.expand_path("~root/.ssh/authorized_keys") resource.should(:target).should == target end - end + + # Bug #2124 - ssh_authorized_key always changes target if target is not defined + it "should not raise spurious change events" do + resource = @class.new(:name => "Test", :user => "root") + target = File.expand_path("~root/.ssh/authorized_keys") + resource.property(:target).insync?(target).should == true + end + end describe "when calling validate" do it "should not crash on a non-existant user" do |
