summaryrefslogtreecommitdiff
path: root/lib/chef/knife.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-10-18 13:36:22 +0100
committerThom May <thom@chef.io>2016-10-18 14:14:13 +0100
commit73510d27e6286a89dc6818161d57292731162eef (patch)
treebd7e23454f54910dc8b7957257c65b542b813e92 /lib/chef/knife.rb
parent1a58b3e8055a2f374e0da38eb7a1c49d035a7c1e (diff)
downloadchef-73510d27e6286a89dc6818161d57292731162eef.tar.gz
Return a raw hash when creating objectstm/last_json_deprecations
Fixes chef/chef-vault#215 Signed-off-by: Thom May <thom@may.lt>
Diffstat (limited to 'lib/chef/knife.rb')
-rw-r--r--lib/chef/knife.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index 0dbd02ceb4..7b7e2711f8 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -525,7 +525,11 @@ class Chef
# FIXME: yard with @yield
def create_object(object, pretty_name = nil, object_class: nil)
- output = edit_data(object, object_class: object_class)
+ output = if object_class
+ edit_data(object, object_class: object_class)
+ else
+ edit_hash(object)
+ end
if Kernel.block_given?
output = yield(output)