From: elijah Date: Wed, 4 Jun 2014 21:44:00 +0000 (-0700) Subject: ensure facts.json is keyed by node name and not hostname X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=dde0c4c9b9444107ac2c991c4c43155d50bc99c0;p=leap%2Fleap_cli.git ensure facts.json is keyed by node name and not hostname --- diff --git a/lib/leap_cli/commands/facts.rb b/lib/leap_cli/commands/facts.rb index 3653c46..43a04df 100644 --- a/lib/leap_cli/commands/facts.rb +++ b/lib/leap_cli/commands/facts.rb @@ -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?