]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
ensure facts.json is keyed by node name and not hostname
authorelijah <elijah@riseup.net>
Wed, 4 Jun 2014 21:44:00 +0000 (14:44 -0700)
committerelijah <elijah@riseup.net>
Wed, 4 Jun 2014 21:44:00 +0000 (14:44 -0700)
lib/leap_cli/commands/facts.rb

index 3653c466a874d3248f5a377d85dd029d644eb7c5..43a04dfbf72705893800154e0d07f7aa96fa5577 100644 (file)
@@ -83,7 +83,12 @@ module LeapCli; module Commands
     new_facts = {}
     ssh_connect(nodes) do |ssh|
       ssh.leap.run_with_progress(facter_cmd) do |response|
-        new_facts[response[:host]] = response[:data].strip
+        node = manager.node(response[:host])
+        if node
+          new_facts[node.name] = response[:data].strip
+        else
+          log :warning, 'Could not find node for hostname %s' % response[:host]
+        end
       end
     end
     overwrite_existing = args.empty?