From dde0c4c9b9444107ac2c991c4c43155d50bc99c0 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 4 Jun 2014 14:44:00 -0700 Subject: ensure facts.json is keyed by node name and not hostname --- lib/leap_cli/commands/facts.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/leap_cli/commands/facts.rb') 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? -- cgit v1.2.3