diff options
author | Lamont Granquist <lamont@chef.io> | 2019-10-27 17:31:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-27 17:31:49 -0700 |
commit | 831c911c1c2b9059f520827b80b673168de0751d (patch) | |
tree | 049b3ee4cbf4c6636d227ed278d0645ae6c2f04e | |
parent | 18fa2a105001a053be46fd3be1b4dd3f7e2a74ce (diff) | |
parent | 542a034b78c263a04e404b249f36f82756629e7b (diff) | |
download | chef-831c911c1c2b9059f520827b80b673168de0751d.tar.gz |
Fix knife node show non-existent attributes (#9025)
Fix knife node show non-existent attributes
-rw-r--r-- | lib/chef/knife/core/generic_presenter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/knife/core/generic_presenter.rb b/lib/chef/knife/core/generic_presenter.rb index 90f529a3d9..f9fce6ca87 100644 --- a/lib/chef/knife/core/generic_presenter.rb +++ b/lib/chef/knife/core/generic_presenter.rb @@ -191,7 +191,7 @@ class Chef data = if data.is_a?(Array) data[attr.to_i] - elsif data.respond_to?(:[], false) && data.key?(attr) + elsif data.respond_to?(:[], false) && data.respond_to?(:key?) && data.key?(attr) data[attr] elsif data.respond_to?(attr.to_sym, false) # handles -a chef_environment and other things that hang of the node and aren't really attributes |