Skip to content

Commit

Permalink
Merge branch 'pull/12'
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed May 25, 2015
2 parents 02fc0d6 + f8a35c4 commit e185af2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/puppet/provider/ssh_config/augeas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def self.get_value(aug, pathx)
def self.set_value(aug, base, path, label, value)
if label =~ /Ciphers|SendEnv|MACs/i
aug.rm("#{path}/*")
# In case there is more than one entry, keep only the first one
aug.rm("#{path}[position() != 1]")
count = 0
value.each do |v|
count += 1
Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/unit/puppet/provider/ssh_config/augeas/full
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Host *
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# RekeyLimit 1G 1h
SendEnv LANG LC_*
SendEnv QUX
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
9 changes: 5 additions & 4 deletions spec/unit/puppet/provider/ssh_config/augeas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,12 @@
}
}

expect(inst.size).to eq(4)
expect(inst.size).to eq(5)
expect(inst[0]).to eq({:name=>"SendEnv", :ensure=>:present, :value=>["LANG", "LC_*"], :key=>"SendEnv", :host=>"*"})
expect(inst[1]).to eq({:name=>"HashKnownHosts", :ensure=>:present, :value=>["yes"], :key=>"HashKnownHosts", :host=>"*"})
expect(inst[2]).to eq({:name=>"GSSAPIAuthentication", :ensure=>:present, :value=>["yes"], :key=>"GSSAPIAuthentication", :host=>"*"})
expect(inst[3]).to eq({:name=>"GSSAPIDelegateCredentials", :ensure=>:present, :value=>["no"], :key=>"GSSAPIDelegateCredentials", :host=>"*"})
expect(inst[1]).to eq({:name=>"SendEnv", :ensure=>:present, :value=>["QUX"], :key=>"SendEnv", :host=>"*"})
expect(inst[2]).to eq({:name=>"HashKnownHosts", :ensure=>:present, :value=>["yes"], :key=>"HashKnownHosts", :host=>"*"})
expect(inst[3]).to eq({:name=>"GSSAPIAuthentication", :ensure=>:present, :value=>["yes"], :key=>"GSSAPIAuthentication", :host=>"*"})
expect(inst[4]).to eq({:name=>"GSSAPIDelegateCredentials", :ensure=>:present, :value=>["no"], :key=>"GSSAPIDelegateCredentials", :host=>"*"})
end

describe "when creating settings" do
Expand Down

0 comments on commit e185af2

Please sign in to comment.