diff options
-rw-r--r-- | lib/chef/chef_fs/config.rb | 2 | ||||
-rw-r--r-- | lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb | 1 | ||||
-rw-r--r-- | spec/integration/knife/download_spec.rb | 11 | ||||
-rw-r--r-- | spec/integration/knife/list_spec.rb | 16 |
4 files changed, 18 insertions, 12 deletions
diff --git a/lib/chef/chef_fs/config.rb b/lib/chef/chef_fs/config.rb index 29579be677..5b9d34441b 100644 --- a/lib/chef/chef_fs/config.rb +++ b/lib/chef/chef_fs/config.rb @@ -236,7 +236,7 @@ class Chef when "static" object_names = %w(cookbooks data_bags environments roles) when "hosted_everything" - object_names = %w(acls clients cookbooks containers data_bags environments groups nodes roles policies policy_groups) + object_names = %w(acls clients cookbooks cookbook_artifacts containers data_bags environments groups nodes roles policies policy_groups) else object_names = %w(clients cookbooks data_bags environments nodes roles users) end diff --git a/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb b/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb index 6a987bd233..0b1480cb2d 100644 --- a/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +++ b/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb @@ -50,7 +50,6 @@ class Chef result = [] root.get_json("#{api_path}/?num_versions=all").each_pair do |cookbook_name, cookbooks| cookbooks["versions"].each do |cookbook_version| - puts cookbook_version result << VersionedCookbookDir.new("#{cookbook_name}-#{cookbook_version['version']}", self) end end diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb index faa640f83b..57229b915a 100644 --- a/spec/integration/knife/download_spec.rb +++ b/spec/integration/knife/download_spec.rb @@ -1148,6 +1148,7 @@ Created /containers/nodes.json Created /containers/policies.json Created /containers/roles.json Created /containers/sandboxes.json +Created /cookbook_artifacts Created /cookbooks Created /data_bags Created /environments @@ -1172,6 +1173,7 @@ EOM # acl_for %w(organizations foo groups blah) client "x", {} cookbook "x", "1.0.0" + cookbook_artifact "x", "1x1", { "metadata.rb" => cb_metadata("x", "1.0.0") } container "x", {} data_bag "x", { "y" => {} } environment "x", {} @@ -1184,7 +1186,7 @@ EOM policy_group "x", { "policies" => { "x" => { "revision_id" => "1.0.0" }, - "blah" => { "revision_id" => "1.0.0" }, + "blah" => { "revision_id" => "1.0.0" } } } role "x", {} @@ -1209,6 +1211,8 @@ EOM knife("download /").should_succeed <<EOM Created /clients/x.json Created /containers/x.json +Created /cookbook_artifacts/x-1x1 +Created /cookbook_artifacts/x-1x1/metadata.rb Created /cookbooks/x Created /cookbooks/x/metadata.rb Created /data_bags/x @@ -1233,6 +1237,7 @@ EOM file "clients/x.json", { "public_key" => ChefZero::PUBLIC_KEY } file "containers/x.json", {} file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0") + file "cookbook_artifacts/x-1x1/metadata.rb", cb_metadata("x", "1.0.0") file "data_bags/x/y.json", {} file "environments/x.json", {} file "groups/x.json", {} @@ -1257,6 +1262,7 @@ EOM file "clients/x.json", { "validator" => true } file "containers/x.json", {} file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.1") + file "cookbook_artifacts/x-1x1/metadata.rb", cb_metadata("x", "1.0.1") file "data_bags/x/y.json", { "a" => "b" } file "environments/x.json", { "description" => "foo" } file "groups/x.json", { "description" => "foo" } @@ -1267,7 +1273,7 @@ EOM file "policy_groups/x.json", { "policies" => { "x" => { "revision_id" => "1.0.1" }, - "y" => { "revision_id" => "1.0.0" }, + "y" => { "revision_id" => "1.0.0" } } } file "roles/x.json", { "run_list" => [ "blah" ] } @@ -1276,6 +1282,7 @@ EOM it "knife download updates everything" do knife("download /").should_succeed <<EOM Updated /clients/x.json +Updated /cookbook_artifacts/x-1x1/metadata.rb Updated /cookbooks/x/metadata.rb Updated /data_bags/x/y.json Updated /environments/x.json diff --git a/spec/integration/knife/list_spec.rb b/spec/integration/knife/list_spec.rb index 544842fe94..85eb959847 100644 --- a/spec/integration/knife/list_spec.rb +++ b/spec/integration/knife/list_spec.rb @@ -893,8 +893,8 @@ EOM container "container2", {} cookbook "cookbook1", "1.0.0" cookbook "cookbook2", "1.0.1", { "recipes" => { "default.rb" => "" } } - cookbook_artifact "cookbook_artifact1", "111" - cookbook_artifact "cookbook_artifact2", "222", { "recipes" => { "default.rb" => "" } } + cookbook_artifact "cookbook_artifact1", "1x1" + cookbook_artifact "cookbook_artifact2", "2x2", { "recipes" => { "default.rb" => "" } } data_bag "bag1", { "item1" => {}, "item2" => {} } data_bag "bag2", { "item1" => {}, "item2" => {} } environment "environment1", {} @@ -980,12 +980,12 @@ EOM /containers/roles.json /containers/sandboxes.json /cookbook_artifacts/ -/cookbook_artifacts/cookbook_artifact1-111/ -/cookbook_artifacts/cookbook_artifact1-111/metadata.rb -/cookbook_artifacts/cookbook_artifact2-222/ -/cookbook_artifacts/cookbook_artifact2-222/metadata.rb -/cookbook_artifacts/cookbook_artifact2-222/recipes/ -/cookbook_artifacts/cookbook_artifact2-222/recipes/default.rb +/cookbook_artifacts/cookbook_artifact1-1x1/ +/cookbook_artifacts/cookbook_artifact1-1x1/metadata.rb +/cookbook_artifacts/cookbook_artifact2-2x2/ +/cookbook_artifacts/cookbook_artifact2-2x2/metadata.rb +/cookbook_artifacts/cookbook_artifact2-2x2/recipes/ +/cookbook_artifacts/cookbook_artifact2-2x2/recipes/default.rb /cookbooks/ /cookbooks/cookbook1/ /cookbooks/cookbook1/metadata.rb |