diff options
author | dheerajd-msys <dheeraj.dubey@msystechnologies.com> | 2019-07-31 12:01:16 +0530 |
---|---|---|
committer | dheerajd-msys <dheeraj.dubey@msystechnologies.com> | 2019-08-06 17:14:42 +0530 |
commit | cd9614237444854de3ed152c776749823ca12f58 (patch) | |
tree | 99ab5026cf31013d85ddce2083fd93ef4d9e9a2b /lib/chef/knife | |
parent | 8bf674755176dbf021019ace42b851d761bda3ce (diff) | |
download | chef-cd9614237444854de3ed152c776749823ca12f58.tar.gz |
fix to avoid conflicts with pattern of other data
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
Diffstat (limited to 'lib/chef/knife')
-rw-r--r-- | lib/chef/knife/core/generic_presenter.rb | 4 | ||||
-rw-r--r-- | lib/chef/knife/node_environment_set.rb | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/chef/knife/core/generic_presenter.rb b/lib/chef/knife/core/generic_presenter.rb index 245496b1d5..90f529a3d9 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 95aab72625..644b6138b6 100644 --- a/lib/chef/knife/node_environment_set.rb +++ b/lib/chef/knife/node_environment_set.rb @@ -44,8 +44,7 @@ class Chef node.save - config[:attribute] = "chef_environment" - + config[:environment] = @environment output(format_for_display(node)) end |