diff options
author | elijah <elijah@riseup.net> | 2016-06-23 15:49:03 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-07-01 14:48:42 -0700 |
commit | c77cace5225eb16d35865664754e88f4d67bba7f (patch) | |
tree | 2198b0e79cc7c397971e5466d07e7eb83ebfa68d /lib/leap_cli/commands/facts.rb | |
parent | cfb91a199c8c205b99c4424df77b0b6ed20e4288 (diff) |
migrate commands to use new ssh system: node init, test, add-user
Diffstat (limited to 'lib/leap_cli/commands/facts.rb')
-rw-r--r-- | lib/leap_cli/commands/facts.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/leap_cli/commands/facts.rb b/lib/leap_cli/commands/facts.rb index 11329ccc..6c954ee8 100644 --- a/lib/leap_cli/commands/facts.rb +++ b/lib/leap_cli/commands/facts.rb @@ -79,15 +79,18 @@ module LeapCli; module Commands private def update_facts(global_options, options, args) + require 'leap_cli/ssh' nodes = manager.filter(args, :local => false, :disabled => false) new_facts = {} - ssh_connect(nodes) do |ssh| - ssh.leap.run_with_progress(facter_cmd) do |response| - node = manager.node(response[:host]) + SSH.remote_command(nodes) do |ssh, host| + response = ssh.capture(facter_cmd, :log_output => false) + if response + log 'done', :host => host + node = manager.node(host) if node - new_facts[node.name] = response[:data].strip + new_facts[node.name] = response.strip else - log :warning, 'Could not find node for hostname %s' % response[:host] + log :warning, 'Could not find node for hostname %s' % host end end end |