diff options
author | John Keiser <jkeiser@opscode.com> | 2013-06-08 12:45:07 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2013-06-10 07:39:02 -0700 |
commit | d1059c4f1af2808b18f4aba26ceef57a946c223b (patch) | |
tree | a932179d7feb1cdfa5e63887356a775ba97a1589 /lib/chef/chef_fs/data_handler/cookbook_data_handler.rb | |
parent | ae7bc21674057c78716e5419752f99397090ce0c (diff) | |
parent | 600cbe10648717b57e661649c205fc49be5dc8e3 (diff) | |
download | chef-d1059c4f1af2808b18f4aba26ceef57a946c223b.tar.gz |
CHEF-3781: Merge the latest knife-essentials (1.3), including:
- Huge performance boost (parallel download/upload/diff)
- Support for Hosted data (acls, groups, containers) for full backup/restore of organizations
- knife deps: dependency tree viewing for objects
- knife xargs, knife edit
- knife integration testing
- Support for multiple cookbook_paths, chef_repo_path config option
- Windows backslash support
- Many edge case fixes, better output and some new command line options
Diffstat (limited to 'lib/chef/chef_fs/data_handler/cookbook_data_handler.rb')
-rw-r--r-- | lib/chef/chef_fs/data_handler/cookbook_data_handler.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb new file mode 100644 index 0000000000..d0333db48f --- /dev/null +++ b/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb @@ -0,0 +1,38 @@ +require 'chef/chef_fs/data_handler/data_handler_base' +require 'chef/cookbook/metadata' + +class Chef + module ChefFS + module DataHandler + class CookbookDataHandler < DataHandlerBase + def normalize(cookbook, entry) + version = entry.name + name = entry.parent.name + result = super(cookbook, { + 'name' => "#{name}-#{version}", + 'version' => version, + 'cookbook_name' => name, + 'json_class' => 'Chef::CookbookVersion', + 'chef_type' => 'cookbook_version', + 'frozen?' => false, + 'metadata' => {} + }) + result['metadata'] = super(result['metadata'], { + 'version' => version, + 'name' => name + }) + end + + def preserve_key(key) + return key == 'cookbook_name' || key == 'version' + end + + def chef_class + Chef::Cookbook::Metadata + end + + # Not using this yet, so not sure if to_ruby will be useful. + end + end + end +end |