summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-05-02 18:36:12 -0700
committerGitHub <noreply@github.com>2019-05-02 18:36:12 -0700
commit749368e4370d31a946c725a619607baafd1cea25 (patch)
tree9e77ac4f51f6045057b6ecb1d4a576737f8b97bf
parenta70938aede1c8686bd451751c1cbf94c3fc980b3 (diff)
parentfd4a38fcbf9d6d9463c1a899adac6223baf3eaa6 (diff)
downloadchef-749368e4370d31a946c725a619607baafd1cea25.tar.gz
Merge pull request #8415 from MsysTechnologiesllc/Vijay/MSYS-1005_knife_status_long_output_runlist
Fixed empty value for knife status long output
-rw-r--r--lib/chef/knife/core/status_presenter.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/chef/knife/core/status_presenter.rb b/lib/chef/knife/core/status_presenter.rb
index 32ad6a13ae..dfd8eb8956 100644
--- a/lib/chef/knife/core/status_presenter.rb
+++ b/lib/chef/knife/core/status_presenter.rb
@@ -100,7 +100,14 @@ class Chef
fqdn = (node[:ec2] && node[:ec2][:public_hostname]) || node[:fqdn]
name = node["name"] || node.name
- run_list = (node["run_list"]).to_s if config[:run_list]
+ if config[:run_list]
+ if config[:long_output]
+ run_list = node.run_list.map { |rl| "#{rl.type}[#{rl.name}]" }
+ else
+ run_list = node["run_list"]
+ end
+ end
+
line_parts = Array.new
if node["ohai_time"]
@@ -128,7 +135,7 @@ class Chef
line_parts << fqdn if fqdn
line_parts << ip if ip
- line_parts << run_list if run_list
+ line_parts << run_list.to_s if run_list
if node["platform"]
platform = node["platform"].dup