diff options
-rw-r--r-- | lib/chef/knife/core/generic_presenter.rb | 4 | ||||
-rw-r--r-- | lib/chef/knife/node_environment_set.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/knife/core/generic_presenter.rb b/lib/chef/knife/core/generic_presenter.rb index 90f529a3d9..245496b1d5 100644 --- a/lib/chef/knife/core/generic_presenter.rb +++ b/lib/chef/knife/core/generic_presenter.rb @@ -191,11 +191,11 @@ class Chef data = if data.is_a?(Array) data[attr.to_i] - elsif data.respond_to?(:[], false) && 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 data.public_send(attr.to_sym) + elsif data.respond_to?(:[], false) && data.key?(attr) + data[attr] else nil end diff --git a/lib/chef/knife/node_environment_set.rb b/lib/chef/knife/node_environment_set.rb index 6630c297b0..95aab72625 100644 --- a/lib/chef/knife/node_environment_set.rb +++ b/lib/chef/knife/node_environment_set.rb @@ -44,7 +44,7 @@ class Chef node.save - config[:environment] = "chef_environment" + config[:attribute] = "chef_environment" output(format_for_display(node)) end |