summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--provider_base/lib/macros/core.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/provider_base/lib/macros/core.rb b/provider_base/lib/macros/core.rb
index 2ab2e71b..7de50f2f 100644
--- a/provider_base/lib/macros/core.rb
+++ b/provider_base/lib/macros/core.rb
@@ -22,6 +22,9 @@ module LeapCli
keys.sort.each do |keyfile|
ssh_type, ssh_key = File.read(keyfile, :encoding => 'UTF-8').strip.split(" ")
name = File.basename(File.dirname(keyfile))
+ until hash[name].nil?
+ i ||= 1; name = "#{name}#{i+=1}"
+ end
hash[name] = {
"type" => ssh_type,
"key" => ssh_key