summaryrefslogtreecommitdiff
path: root/provider_base/lib/macros
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-12-21 16:45:17 -0800
committerelijah <elijah@riseup.net>2014-12-21 16:45:17 -0800
commit1f9f5f11cbf5ee3e9929203ceb2053f5ca164f5a (patch)
tree6b5e4bb731f0437f28d32ba0f825bc02dba680f2 /provider_base/lib/macros
parent50424b752f844305494686afbb1c73995ebfaf39 (diff)
fixed bug that prevented all users/*/*_ssh.pub keys from getting added to authorized_keys
Diffstat (limited to 'provider_base/lib/macros')
-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