diff options
author | Thom May <thom@may.lt> | 2015-04-08 15:58:51 +0100 |
---|---|---|
committer | Thom May <thom@may.lt> | 2015-04-08 15:58:51 +0100 |
commit | 12288b8ba5541cbd639fa2ee030c031ede6703e1 (patch) | |
tree | a5da5c5b1961290f70cc379edd72951dba9956e0 /lib/chef/knife/core/status_presenter.rb | |
parent | a0872d16eda17b7fb144513425a2a4af2bc8c369 (diff) | |
download | chef-12288b8ba5541cbd639fa2ee030c031ede6703e1.tar.gz |
use partial search
Diffstat (limited to 'lib/chef/knife/core/status_presenter.rb')
-rw-r--r-- | lib/chef/knife/core/status_presenter.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/chef/knife/core/status_presenter.rb b/lib/chef/knife/core/status_presenter.rb index 3298d5e4ac..a6cb7448db 100644 --- a/lib/chef/knife/core/status_presenter.rb +++ b/lib/chef/knife/core/status_presenter.rb @@ -66,16 +66,16 @@ class Chef list.each do |node| result = {} - result["name"] = node.name - result["chef_environment"] = node.chef_environment - ip = (node[:ec2] && node[:ec2][:public_ipv4]) || node[:ipaddress] - fqdn = (node[:ec2] && node[:ec2][:public_hostname]) || node[:fqdn] + result["name"] = node["name"] + result["chef_environment"] = node["chef_environment"] + ip = (node["ec2"] && node["ec2"]["public_ipv4"]) || node["ipaddress"] + fqdn = (node["ec2"] && node["ec2"]["public_hostname"]) || node["fqdn"] result["ip"] = ip if ip result["fqdn"] = fqdn if fqdn - result["run_list"] = node.run_list if config[:run_list] - result["ohai_time"] = node[:ohai_time] - result["platform"] = node[:platform] if node[:platform] - result["platform_version"] = node[:platform_version] if node[:platform_version] + result["run_list"] = node.run_list if config["run_list"] + result["ohai_time"] = node["ohai_time"] + result["platform"] = node["platform"] if node["platform"] + result["platform_version"] = node["platform_version"] if node["platform_version"] if config[:long_output] result["default"] = node.default_attrs @@ -100,10 +100,10 @@ class Chef ip = (node[:ec2] && node[:ec2][:public_ipv4]) || node[:ipaddress] fqdn = (node[:ec2] && node[:ec2][:public_hostname]) || node[:fqdn] - hours, minutes, seconds = time_difference_in_hms(node["ohai_time"]) + hours, minutes, _ = time_difference_in_hms(node["ohai_time"]) hours_text = "#{hours} hour#{hours == 1 ? ' ' : 's'}" minutes_text = "#{minutes} minute#{minutes == 1 ? ' ' : 's'}" - run_list = "#{node.run_list}" if config[:run_list] + run_list = "#{node['run_list']}" if config[:run_list] if hours > 24 color = :red text = hours_text @@ -116,7 +116,7 @@ class Chef end line_parts = Array.new - line_parts << @ui.color(text, color) + ' ago' << node.name + line_parts << @ui.color(text, color) + ' ago' << node['name'] line_parts << fqdn if fqdn line_parts << ip if ip line_parts << run_list if run_list |