aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/leap_cli/commands/node.rb3
-rw-r--r--lib/leap_cli/commands/user.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/leap_cli/commands/node.rb b/lib/leap_cli/commands/node.rb
index e200a19..d05e233 100644
--- a/lib/leap_cli/commands/node.rb
+++ b/lib/leap_cli/commands/node.rb
@@ -55,7 +55,8 @@ module LeapCli; module Commands
#
def update_known_hosts
buffer = StringIO.new
- manager.nodes.values.each do |node|
+ manager.nodes.keys.sort.each do |node_name|
+ node = manager.nodes[node_name]
hostnames = [node.name, node.domain.internal, node.domain.full, node.ip_address].join(',')
pub_key = read_file([:node_ssh_pub_key,node.name])
if pub_key
diff --git a/lib/leap_cli/commands/user.rb b/lib/leap_cli/commands/user.rb
index fbc366a..f0509ac 100644
--- a/lib/leap_cli/commands/user.rb
+++ b/lib/leap_cli/commands/user.rb
@@ -119,7 +119,7 @@ module LeapCli
def update_authorized_keys
buffer = StringIO.new
- Dir.glob(path([:user_ssh, '*'])).each do |keyfile|
+ Dir.glob(path([:user_ssh, '*'])).sort.each do |keyfile|
ssh_type, ssh_key = File.read(keyfile).strip.split(" ")
buffer << ssh_type
buffer << " "