chef-dk 3.3.23 → 3.4.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -7
- data/Gemfile.lock +91 -82
- data/lib/chef-dk/cli.rb +13 -13
- data/lib/chef-dk/command/base.rb +8 -8
- data/lib/chef-dk/command/clean_policy_cookbooks.rb +10 -10
- data/lib/chef-dk/command/clean_policy_revisions.rb +9 -9
- data/lib/chef-dk/command/delete_policy.rb +9 -9
- data/lib/chef-dk/command/delete_policy_group.rb +9 -9
- data/lib/chef-dk/command/diff.rb +35 -35
- data/lib/chef-dk/command/export.rb +11 -11
- data/lib/chef-dk/command/generate.rb +3 -3
- data/lib/chef-dk/command/generator_commands.rb +24 -24
- data/lib/chef-dk/command/generator_commands/build_cookbook.rb +3 -3
- data/lib/chef-dk/command/generator_commands/chef_exts/generator_desc_resource.rb +1 -1
- data/lib/chef-dk/command/generator_commands/cookbook.rb +3 -3
- data/lib/chef-dk/command/generator_commands/cookbook_file.rb +3 -3
- data/lib/chef-dk/command/generator_commands/generator_generator.rb +5 -5
- data/lib/chef-dk/command/generator_commands/template.rb +3 -3
- data/lib/chef-dk/command/install.rb +11 -11
- data/lib/chef-dk/command/provision.rb +32 -32
- data/lib/chef-dk/command/push.rb +9 -9
- data/lib/chef-dk/command/push_archive.rb +9 -9
- data/lib/chef-dk/command/shell_init.rb +21 -21
- data/lib/chef-dk/command/show_policy.rb +11 -11
- data/lib/chef-dk/command/undelete.rb +17 -17
- data/lib/chef-dk/command/update.rb +12 -12
- data/lib/chef-dk/command/verify.rb +63 -63
- data/lib/chef-dk/component_test.rb +3 -3
- data/lib/chef-dk/exceptions.rb +5 -5
- data/lib/chef-dk/generator.rb +61 -61
- data/lib/chef-dk/helpers.rb +1 -1
- data/lib/chef-dk/policyfile/cookbook_location_specification.rb +1 -1
- data/lib/chef-dk/policyfile/cookbook_locks.rb +1 -1
- data/lib/chef-dk/policyfile/git_lock_fetcher.rb +7 -7
- data/lib/chef-dk/policyfile/policyfile_location_specification.rb +1 -1
- data/lib/chef-dk/policyfile/uploader.rb +4 -4
- data/lib/chef-dk/policyfile_compiler.rb +1 -1
- data/lib/chef-dk/policyfile_services/export_repo.rb +49 -49
- data/lib/chef-dk/policyfile_services/install.rb +3 -3
- data/lib/chef-dk/policyfile_services/push_archive.rb +5 -5
- data/lib/chef-dk/policyfile_services/rm_policy_group.rb +1 -1
- data/lib/chef-dk/policyfile_services/update_attributes.rb +2 -2
- data/lib/chef-dk/service_exception_inspectors/http.rb +9 -9
- data/lib/chef-dk/skeletons/code_generator/recipes/recipe.rb +6 -6
- data/lib/chef-dk/version.rb +1 -1
- data/lib/kitchen/provisioner/policyfile_zero.rb +9 -9
- data/omnibus_overrides.rb +1 -1
- data/spec/spec_helper.rb +3 -3
- data/spec/unit/cli_spec.rb +9 -9
- data/spec/unit/command/base_spec.rb +25 -25
- data/spec/unit/command/clean_policy_cookbooks_spec.rb +6 -6
- data/spec/unit/command/clean_policy_revisions_spec.rb +6 -6
- data/spec/unit/command/delete_policy_group_spec.rb +6 -6
- data/spec/unit/command/delete_policy_spec.rb +6 -6
- data/spec/unit/command/export_spec.rb +10 -10
- data/spec/unit/command/generate_spec.rb +5 -5
- data/spec/unit/command/generator_commands/build_cookbook_spec.rb +15 -15
- data/spec/unit/command/generator_commands/cookbook_spec.rb +174 -174
- data/spec/unit/command/generator_commands/generator_generator_spec.rb +5 -5
- data/spec/unit/command/generator_commands/policyfile_spec.rb +15 -15
- data/spec/unit/command/generator_commands/repo_spec.rb +16 -16
- data/spec/unit/command/install_spec.rb +15 -15
- data/spec/unit/command/provision_spec.rb +25 -25
- data/spec/unit/command/push_spec.rb +12 -12
- data/spec/unit/command/shell_init_spec.rb +59 -59
- data/spec/unit/command/show_policy_spec.rb +6 -6
- data/spec/unit/command/undelete_spec.rb +6 -6
- data/spec/unit/command/update_spec.rb +30 -30
- data/spec/unit/fixtures/command/cli_test_command.rb +1 -1
- data/spec/unit/policyfile/chef_server_lock_fetcher_spec.rb +41 -41
- data/spec/unit/policyfile/comparison_base_spec.rb +38 -38
- data/spec/unit/policyfile/cookbook_locks_spec.rb +3 -3
- data/spec/unit/policyfile/differ_spec.rb +361 -361
- data/spec/unit/policyfile/git_lock_fetcher_spec.rb +34 -34
- data/spec/unit/policyfile/included_policies_cookbook_source_spec.rb +6 -6
- data/spec/unit/policyfile/local_lock_fetcher_spec.rb +35 -35
- data/spec/unit/policyfile/lock_applier_spec.rb +6 -6
- data/spec/unit/policyfile/reports/upload_spec.rb +5 -5
- data/spec/unit/policyfile/uploader_spec.rb +27 -27
- data/spec/unit/policyfile_demands_spec.rb +84 -84
- data/spec/unit/policyfile_evaluation_spec.rb +14 -14
- data/spec/unit/policyfile_includes_spec.rb +1 -1
- data/spec/unit/policyfile_install_with_includes_spec.rb +3 -3
- data/spec/unit/policyfile_lock_build_spec.rb +58 -58
- data/spec/unit/policyfile_lock_validation_spec.rb +108 -108
- data/spec/unit/policyfile_services/clean_policies_spec.rb +12 -12
- data/spec/unit/policyfile_services/clean_policy_cookbooks_spec.rb +9 -9
- data/spec/unit/policyfile_services/export_repo_spec.rb +64 -64
- data/spec/unit/policyfile_services/install_spec.rb +4 -4
- data/spec/unit/policyfile_services/push_archive_spec.rb +41 -41
- data/spec/unit/policyfile_services/push_spec.rb +38 -38
- data/spec/unit/policyfile_services/rm_policy_group_spec.rb +12 -12
- data/spec/unit/policyfile_services/rm_policy_spec.rb +6 -6
- data/spec/unit/policyfile_services/show_policy_spec.rb +161 -161
- data/spec/unit/policyfile_services/undelete_spec.rb +13 -13
- data/spec/unit/policyfile_services/update_attributes_spec.rb +6 -6
- data/spec/unit/policyfile_services/update_spec.rb +7 -7
- data/spec/unit/service_exception_inspectors/http_spec.rb +12 -12
- metadata +2 -2
@@ -134,10 +134,10 @@ describe ChefDK::PolicyfileServices::Undelete do
|
|
134
134
|
|
135
135
|
timestamps = times.map { |t| t.utc.strftime("%Y%m%d%H%M%S") }
|
136
136
|
|
137
|
-
expected_output =
|
138
|
-
#{timestamps[2]}: delete-policy-group example3
|
139
|
-
#{timestamps[1]}: delete-policy-group example2
|
140
|
-
#{timestamps[0]}: delete-policy-group example1
|
137
|
+
expected_output = <<~OUTPUT
|
138
|
+
#{timestamps[2]}: delete-policy-group example3
|
139
|
+
#{timestamps[1]}: delete-policy-group example2
|
140
|
+
#{timestamps[0]}: delete-policy-group example1
|
141
141
|
OUTPUT
|
142
142
|
expect(ui.output).to eq(expected_output)
|
143
143
|
end
|
@@ -193,9 +193,9 @@ OUTPUT
|
|
193
193
|
end
|
194
194
|
|
195
195
|
before do
|
196
|
-
expect(http_client).to receive(:put)
|
197
|
-
with("/policy_groups/example1/policies/appserver", policy_revision)
|
198
|
-
and_raise(http_exception)
|
196
|
+
expect(http_client).to receive(:put)
|
197
|
+
.with("/policy_groups/example1/policies/appserver", policy_revision)
|
198
|
+
.and_raise(http_exception)
|
199
199
|
end
|
200
200
|
|
201
201
|
it "raises an error" do
|
@@ -207,8 +207,8 @@ OUTPUT
|
|
207
207
|
context "when the undelete is successful" do
|
208
208
|
|
209
209
|
before do
|
210
|
-
expect(http_client).to receive(:put)
|
211
|
-
with("/policy_groups/example1/policies/appserver", policy_revision)
|
210
|
+
expect(http_client).to receive(:put)
|
211
|
+
.with("/policy_groups/example1/policies/appserver", policy_revision)
|
212
212
|
end
|
213
213
|
|
214
214
|
it "uploads all policies to the server" do
|
@@ -239,8 +239,8 @@ OUTPUT
|
|
239
239
|
before do
|
240
240
|
expect(undo_stack).to receive(:has_id?).with(undo_record_id).and_return(true)
|
241
241
|
expect(undo_stack).to receive(:delete).with(undo_record_id).and_yield(undo_record1)
|
242
|
-
expect(http_client).to receive(:put)
|
243
|
-
with("/policy_groups/example1/policies/appserver", policy_revision)
|
242
|
+
expect(http_client).to receive(:put)
|
243
|
+
.with("/policy_groups/example1/policies/appserver", policy_revision)
|
244
244
|
end
|
245
245
|
|
246
246
|
it "uploads all policies to the server" do
|
@@ -286,8 +286,8 @@ OUTPUT
|
|
286
286
|
context "when the revision to create doesn't exist" do
|
287
287
|
|
288
288
|
before do
|
289
|
-
expect(http_client).to receive(:post)
|
290
|
-
with("/policies/appserver/revisions", policy_revision)
|
289
|
+
expect(http_client).to receive(:post)
|
290
|
+
.with("/policies/appserver/revisions", policy_revision)
|
291
291
|
end
|
292
292
|
|
293
293
|
it "uploads all policies to the server" do
|
@@ -48,16 +48,16 @@ describe ChefDK::PolicyfileServices::UpdateAttributes do
|
|
48
48
|
let(:local_cookbook_copy_path) { File.join(working_dir, "cookbooks/local-cookbook") }
|
49
49
|
|
50
50
|
let(:policyfile_content) do
|
51
|
-
|
52
|
-
name 'install-example'
|
51
|
+
<<~E
|
52
|
+
name 'install-example'
|
53
53
|
|
54
|
-
run_list 'local-cookbook'
|
54
|
+
run_list 'local-cookbook'
|
55
55
|
|
56
|
-
cookbook 'local-cookbook', path: 'cookbooks/local-cookbook'
|
56
|
+
cookbook 'local-cookbook', path: 'cookbooks/local-cookbook'
|
57
57
|
|
58
|
-
default["default_attr"] = "new_value_default"
|
58
|
+
default["default_attr"] = "new_value_default"
|
59
59
|
|
60
|
-
override["override_attr"] = "new_value_override"
|
60
|
+
override["override_attr"] = "new_value_override"
|
61
61
|
E
|
62
62
|
end
|
63
63
|
|
@@ -48,15 +48,15 @@ describe ChefDK::PolicyfileServices::Install do
|
|
48
48
|
end
|
49
49
|
|
50
50
|
let(:policyfile_content) do
|
51
|
-
|
52
|
-
default_source :community
|
53
|
-
name 'install-example'
|
51
|
+
<<~EOH
|
52
|
+
default_source :community
|
53
|
+
name 'install-example'
|
54
54
|
|
55
|
-
run_list 'top-level'
|
55
|
+
run_list 'top-level'
|
56
56
|
|
57
|
-
cookbook 'top-level'
|
58
|
-
cookbook 'top-level-bis'
|
59
|
-
cookbook 'b', '>= 1.2.3'
|
57
|
+
cookbook 'top-level'
|
58
|
+
cookbook 'top-level-bis'
|
59
|
+
cookbook 'b', '>= 1.2.3'
|
60
60
|
EOH
|
61
61
|
end
|
62
62
|
|
@@ -108,27 +108,27 @@ describe ChefDK::ServiceExceptionInspectors::HTTP do
|
|
108
108
|
let(:response_body) { "this is the response" }
|
109
109
|
|
110
110
|
it "shows the request in a format similar to HTTP messages" do
|
111
|
-
expected_request_string =
|
112
|
-
--- REQUEST DATA ----
|
113
|
-
POST /organizations/chef-oss-dev/cookbooks
|
114
|
-
content-type: application/json
|
115
|
-
accept: application/json
|
111
|
+
expected_request_string = <<~E
|
112
|
+
--- REQUEST DATA ----
|
113
|
+
POST /organizations/chef-oss-dev/cookbooks
|
114
|
+
content-type: application/json
|
115
|
+
accept: application/json
|
116
116
|
|
117
|
-
this is the request
|
117
|
+
this is the request
|
118
118
|
|
119
119
|
E
|
120
120
|
expect(inspector.extended_error_info).to include(expected_request_string)
|
121
121
|
end
|
122
122
|
|
123
123
|
it "shows the response in a format similar to HTTP messages" do
|
124
|
-
expected_response_string =
|
125
|
-
--- RESPONSE DATA ---
|
126
|
-
400 Bad Request
|
127
|
-
server: ngx_openresty
|
128
|
-
date: Wed, 29 Oct 2014 22:27:47 GMT
|
124
|
+
expected_response_string = <<~E
|
125
|
+
--- RESPONSE DATA ---
|
126
|
+
400 Bad Request
|
127
|
+
server: ngx_openresty
|
128
|
+
date: Wed, 29 Oct 2014 22:27:47 GMT
|
129
129
|
|
130
130
|
|
131
|
-
this is the response
|
131
|
+
this is the response
|
132
132
|
E
|
133
133
|
expect(inspector.extended_error_info).to include(expected_response_string)
|
134
134
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-dk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.38
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel DeLeo
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-10-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mixlib-cli
|