Skip to content

Commit f64d389

Browse files
authored
Merge pull request #38 from Dorin-Pleava/MODULES-10827/alias_title_name
(MODULES-10827) Exported sshkey already exists error
2 parents 8683821 + 818e45b commit f64d389

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/puppet/type/sshkey.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def name
1212
"#{self[:name]}@#{self[:type]}"
1313
end
1414

15+
alias_method :title, :name
16+
1517
def self.parameters_to_include
1618
[:name, :type]
1719
end

spec/unit/type/sshkey_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,10 @@
8181
described_class.new(name: 'host,host.domain,ip')
8282
}.to raise_error(Puppet::Error, %r{No comma in resourcename})
8383
end
84+
85+
it 'aliases :title to :name' do
86+
key = described_class.new(name: 'foo', type: :rsa)
87+
expect(key.name).to eq key.title
88+
end
8489
end
8590
end

0 commit comments

Comments
 (0)