summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb')
-rw-r--r--lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb
index e2d0f43de2..d56f662c5c 100644
--- a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb
+++ b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb
@@ -1,5 +1,5 @@
-require 'chef/chef_fs/data_handler/data_handler_base'
-require 'chef/data_bag_item'
+require "chef/chef_fs/data_handler/data_handler_base"
+require "chef/data_bag_item"
class Chef
module ChefFS
@@ -7,19 +7,19 @@ class Chef
class DataBagItemDataHandler < DataHandlerBase
def normalize(data_bag_item, entry)
# If it's wrapped with raw_data, unwrap it.
- if data_bag_item['json_class'] == 'Chef::DataBagItem' && data_bag_item['raw_data']
- data_bag_item = data_bag_item['raw_data']
+ if data_bag_item["json_class"] == "Chef::DataBagItem" && data_bag_item["raw_data"]
+ data_bag_item = data_bag_item["raw_data"]
end
# chef_type and data_bag come back in PUT and POST results, but we don't
# use those in knife-essentials.
normalize_hash(data_bag_item, {
- 'id' => remove_dot_json(entry.name)
+ "id" => remove_dot_json(entry.name)
},)
end
def normalize_for_post(data_bag_item, entry)
- if data_bag_item['json_class'] == 'Chef::DataBagItem' && data_bag_item['raw_data']
- data_bag_item = data_bag_item['raw_data']
+ if data_bag_item["json_class"] == "Chef::DataBagItem" && data_bag_item["raw_data"]
+ data_bag_item = data_bag_item["raw_data"]
end
{
"name" => "data_bag_item_#{entry.parent.name}_#{remove_dot_json(entry.name)}",
@@ -35,7 +35,7 @@ class Chef
end
def preserve_key?(key)
- return key == 'id'
+ return key == "id"
end
def chef_class
@@ -44,7 +44,7 @@ class Chef
def verify_integrity(object, entry, &on_error)
base_name = remove_dot_json(entry.name)
- if object['raw_data']['id'] != base_name
+ if object["raw_data"]["id"] != base_name
on_error.call("ID in #{entry.path_for_printing} must be '#{base_name}' (is '#{object['raw_data']['id']}')")
end
end