chef-dk 3.6.57 → 3.7.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -2
  3. data/Gemfile.lock +54 -54
  4. data/Rakefile +6 -2
  5. data/chef-dk.gemspec +2 -2
  6. data/lib/chef-dk/cli.rb +1 -1
  7. data/lib/chef-dk/command/clean_policy_cookbooks.rb +1 -1
  8. data/lib/chef-dk/command/clean_policy_revisions.rb +1 -1
  9. data/lib/chef-dk/command/delete_policy.rb +1 -1
  10. data/lib/chef-dk/command/delete_policy_group.rb +1 -1
  11. data/lib/chef-dk/command/diff.rb +1 -1
  12. data/lib/chef-dk/command/export.rb +1 -1
  13. data/lib/chef-dk/command/generate.rb +1 -1
  14. data/lib/chef-dk/command/generator_commands/generator_generator.rb +1 -1
  15. data/lib/chef-dk/command/install.rb +1 -1
  16. data/lib/chef-dk/command/provision.rb +6 -3
  17. data/lib/chef-dk/command/push.rb +1 -1
  18. data/lib/chef-dk/command/push_archive.rb +1 -1
  19. data/lib/chef-dk/command/shell_init.rb +1 -1
  20. data/lib/chef-dk/command/show_policy.rb +1 -1
  21. data/lib/chef-dk/command/undelete.rb +1 -1
  22. data/lib/chef-dk/command/update.rb +1 -1
  23. data/lib/chef-dk/command/verify.rb +2 -2
  24. data/lib/chef-dk/generator.rb +4 -4
  25. data/lib/chef-dk/policyfile/git_lock_fetcher.rb +1 -1
  26. data/lib/chef-dk/policyfile/uploader.rb +1 -1
  27. data/lib/chef-dk/policyfile_services/export_repo.rb +2 -2
  28. data/lib/chef-dk/policyfile_services/push_archive.rb +1 -1
  29. data/lib/chef-dk/service_exception_inspectors/http.rb +1 -1
  30. data/lib/chef-dk/version.rb +1 -1
  31. data/spec/unit/cli_spec.rb +1 -1
  32. data/spec/unit/command/base_spec.rb +3 -3
  33. data/spec/unit/command/clean_policy_cookbooks_spec.rb +2 -2
  34. data/spec/unit/command/clean_policy_revisions_spec.rb +2 -2
  35. data/spec/unit/command/delete_policy_group_spec.rb +2 -2
  36. data/spec/unit/command/delete_policy_spec.rb +2 -2
  37. data/spec/unit/command/export_spec.rb +3 -3
  38. data/spec/unit/command/generate_spec.rb +1 -1
  39. data/spec/unit/command/generator_commands/build_cookbook_spec.rb +2 -2
  40. data/spec/unit/command/generator_commands/cookbook_spec.rb +15 -15
  41. data/spec/unit/command/generator_commands/generator_generator_spec.rb +1 -1
  42. data/spec/unit/command/generator_commands/policyfile_spec.rb +1 -1
  43. data/spec/unit/command/generator_commands/repo_spec.rb +3 -3
  44. data/spec/unit/command/install_spec.rb +2 -2
  45. data/spec/unit/command/provision_spec.rb +7 -7
  46. data/spec/unit/command/push_spec.rb +2 -2
  47. data/spec/unit/command/shell_init_spec.rb +5 -5
  48. data/spec/unit/command/show_policy_spec.rb +2 -2
  49. data/spec/unit/command/undelete_spec.rb +2 -2
  50. data/spec/unit/command/update_spec.rb +4 -4
  51. data/spec/unit/policyfile/chef_server_lock_fetcher_spec.rb +1 -1
  52. data/spec/unit/policyfile/comparison_base_spec.rb +1 -1
  53. data/spec/unit/policyfile/differ_spec.rb +8 -8
  54. data/spec/unit/policyfile/git_lock_fetcher_spec.rb +8 -8
  55. data/spec/unit/policyfile/local_lock_fetcher_spec.rb +1 -1
  56. data/spec/unit/policyfile/reports/upload_spec.rb +1 -1
  57. data/spec/unit/policyfile_demands_spec.rb +5 -5
  58. data/spec/unit/policyfile_evaluation_spec.rb +3 -3
  59. data/spec/unit/policyfile_lock_build_spec.rb +14 -14
  60. data/spec/unit/policyfile_lock_validation_spec.rb +13 -13
  61. data/spec/unit/policyfile_services/clean_policies_spec.rb +3 -3
  62. data/spec/unit/policyfile_services/export_repo_spec.rb +2 -2
  63. data/spec/unit/policyfile_services/install_spec.rb +1 -1
  64. data/spec/unit/policyfile_services/push_archive_spec.rb +2 -2
  65. data/spec/unit/policyfile_services/push_spec.rb +1 -1
  66. data/spec/unit/policyfile_services/show_policy_spec.rb +13 -13
  67. data/spec/unit/policyfile_services/undelete_spec.rb +1 -1
  68. data/spec/unit/policyfile_services/update_attributes_spec.rb +1 -1
  69. data/spec/unit/policyfile_services/update_spec.rb +1 -1
  70. data/spec/unit/service_exception_inspectors/http_spec.rb +2 -2
  71. metadata +9 -29
  72. data/acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml +0 -27
  73. data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +0 -287
  74. data/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml +0 -52
  75. data/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb +0 -51
  76. data/acceptance/.shared/kitchen_acceptance/metadata.rb +0 -1
  77. data/acceptance/Gemfile +0 -21
  78. data/acceptance/Gemfile.lock +0 -335
  79. data/acceptance/README.md +0 -132
  80. data/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore +0 -2
  81. data/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb +0 -2
  82. data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb +0 -1
  83. data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb +0 -1
  84. data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb +0 -1
  85. data/acceptance/trivial/.kitchen.yml +0 -7
  86. data/acceptance/trivial/test/integration/chefdk-current-install/inspec/chef_client_spec.rb +0 -5
  87. data/tasks/announce.rb +0 -57
  88. data/tasks/bin/bundle-platform.bat +0 -2
  89. data/tasks/dependencies.rb +0 -56
  90. data/tasks/templates/prerelease.md.erb +0 -26
  91. data/tasks/templates/release.md.erb +0 -26
@@ -186,7 +186,7 @@ describe ChefDK::Command::GeneratorCommands::GeneratorGenerator do
186
186
  long_description 'Custom code generator cookbook for use with ChefDK'
187
187
  version '0.1.0'
188
188
 
189
- METADATA
189
+ METADATA
190
190
  expect(metadata_content).to eq(expected_metadata)
191
191
  end
192
192
  end
@@ -134,7 +134,7 @@ describe ChefDK::Command::GeneratorCommands::Policyfile do
134
134
 
135
135
  # Specify a custom source for a single cookbook:
136
136
  # cookbook 'example_cookbook', path: '../cookbooks/example_cookbook'
137
- POLICYFILE_RB
137
+ POLICYFILE_RB
138
138
  end
139
139
 
140
140
  before do
@@ -300,7 +300,7 @@ describe ChefDK::Command::GeneratorCommands::Repo do
300
300
  Create policyfiles here. When using a chef-repo, give your policyfiles
301
301
  the same filename as the name set in the policyfile itself, and use the
302
302
  `.rb` file extension.
303
- README
303
+ README
304
304
  end
305
305
 
306
306
  it "has the right contents" do
@@ -334,7 +334,7 @@ README
334
334
  For more information on roles, see the Chef wiki page:
335
335
 
336
336
  https://docs.chef.io/roles.html
337
- README
337
+ README
338
338
  end
339
339
 
340
340
  it "has the right contents" do
@@ -358,7 +358,7 @@ README
358
358
  For more information on environments, see the Chef wiki page:
359
359
 
360
360
  https://docs.chef.io/environments.html
361
- README
361
+ README
362
362
  end
363
363
 
364
364
  it "has the right contents" do
@@ -148,7 +148,7 @@ describe ChefDK::Command::Install do
148
148
  Error: install failed
149
149
  Reason: (StandardError) some operation failed
150
150
 
151
- E
151
+ E
152
152
 
153
153
  command.run
154
154
  expect(ui.output).to eq(expected_error_text)
@@ -164,7 +164,7 @@ E
164
164
  Reason: (StandardError) some operation failed
165
165
 
166
166
 
167
- E
167
+ E
168
168
 
169
169
  expected_error_text << backtrace.join("\n") << "\n"
170
170
 
@@ -288,7 +288,7 @@ describe ChefDK::Command::Provision do
288
288
  # SSL Settings:
289
289
  ssl_verify_mode :verify_peer
290
290
 
291
- CONFIG
291
+ CONFIG
292
292
  expect(context.chef_config).to eq(expected_config)
293
293
  end
294
294
 
@@ -369,7 +369,7 @@ CONFIG
369
369
  policy_group "some-policy-group"
370
370
  policy_name "myapp"
371
371
 
372
- CONFIG
372
+ CONFIG
373
373
  expect(context.chef_config).to eq(expected_config)
374
374
  end
375
375
 
@@ -416,7 +416,7 @@ CONFIG
416
416
  policy_group "some-policy-group"
417
417
  policy_name "myapp"
418
418
 
419
- CONFIG
419
+ CONFIG
420
420
  expect(context.chef_config).to eq(expected_config)
421
421
  end
422
422
 
@@ -497,7 +497,7 @@ CONFIG
497
497
  Error: push failed
498
498
  Reason: (StandardError) some operation failed
499
499
 
500
- E
500
+ E
501
501
  expect(command.run(params)).to eq(1)
502
502
  expect(ui.output).to include(expected_output)
503
503
  end
@@ -549,7 +549,7 @@ E
549
549
 
550
550
  it "exits 0" do
551
551
  return_value = command.run(params)
552
- expect(ui.output).to eq("")
552
+ expect(ui.output).to eq("DEPRECATED: This command is deprecated and will be removed in ChefDK 4.\n")
553
553
  expect(return_value).to eq(0)
554
554
  end
555
555
 
@@ -561,7 +561,7 @@ E
561
561
 
562
562
  it "exits 0" do
563
563
  return_value = command.run(params)
564
- expect(ui.output).to eq("")
564
+ expect(ui.output).to eq("DEPRECATED: This command is deprecated and will be removed in ChefDK 4.\n")
565
565
  expect(return_value).to eq(0)
566
566
  end
567
567
  end
@@ -577,7 +577,7 @@ E
577
577
 
578
578
  it "exits 0" do
579
579
  return_value = command.run(params)
580
- expect(ui.output).to eq("")
580
+ expect(ui.output).to eq("DEPRECATED: This command is deprecated and will be removed in ChefDK 4.\n")
581
581
  expect(return_value).to eq(0)
582
582
  end
583
583
 
@@ -162,7 +162,7 @@ describe ChefDK::Command::Push do
162
162
  Error: push failed
163
163
  Reason: (StandardError) some operation failed
164
164
 
165
- E
165
+ E
166
166
 
167
167
  expect(ui.output).to eq(expected_output)
168
168
  end
@@ -182,7 +182,7 @@ E
182
182
  Reason: (StandardError) some operation failed
183
183
 
184
184
 
185
- E
185
+ E
186
186
  expected_output << backtrace.join("\n") << "\n"
187
187
 
188
188
  expect(ui.output).to eq(expected_output)
@@ -106,7 +106,7 @@ describe ChefDK::Command::ShellInit do
106
106
  export GEM_ROOT="#{expected_gem_root}"
107
107
  export GEM_HOME="#{expected_gem_home}"
108
108
  export GEM_PATH="#{expected_gem_path}"
109
- EOH
109
+ EOH
110
110
  end
111
111
  include_context "shell init script", shell
112
112
  end
@@ -122,7 +122,7 @@ EOH
122
122
  $env:GEM_ROOT="#{expected_gem_root}"
123
123
  $env:GEM_HOME="#{expected_gem_home}"
124
124
  $env:GEM_PATH="#{expected_gem_path}"
125
- EOH
125
+ EOH
126
126
  end
127
127
  include_context "shell init script", shell
128
128
  end
@@ -157,7 +157,7 @@ EOH
157
157
  COMPREPLY=($(compgen -W "$COMMANDS" -- ${COMP_WORDS[COMP_CWORD]} ))
158
158
  }
159
159
  complete -F _chef_comp chef
160
- END_COMPLETION
160
+ END_COMPLETION
161
161
  end
162
162
 
163
163
  before do
@@ -253,7 +253,7 @@ END_COMPLETION
253
253
  set -gx GEM_ROOT "#{expected_gem_root}";
254
254
  set -gx GEM_HOME "#{expected_gem_home}";
255
255
  set -gx GEM_PATH "#{expected_gem_path}";
256
- EOH
256
+ EOH
257
257
  end
258
258
 
259
259
  include_context "shell init script", "fish"
@@ -287,7 +287,7 @@ EOH
287
287
  complete -c chef -f -n '__fish_chef_no_command' -a env -d "Prints environment variables used by ChefDK"
288
288
  complete -c chef -f -n '__fish_chef_no_command' -a gem -d "Runs the `gem` command in context of the embedded ruby"
289
289
  complete -c chef -f -n '__fish_chef_no_command' -a generate -d "Generate a new app, cookbook, or component"
290
- END_COMPLETION
290
+ END_COMPLETION
291
291
  end
292
292
 
293
293
  before do
@@ -192,7 +192,7 @@ describe ChefDK::Command::ShowPolicy do
192
192
  Error: Failed to list policies
193
193
  Reason: (StandardError) some operation failed
194
194
 
195
- E
195
+ E
196
196
 
197
197
  expect(ui.output).to eq(expected_output)
198
198
  end
@@ -208,7 +208,7 @@ E
208
208
  Reason: (StandardError) some operation failed
209
209
 
210
210
 
211
- E
211
+ E
212
212
  expected_output << backtrace.join("\n") << "\n"
213
213
 
214
214
  expect(ui.output).to eq(expected_output)
@@ -200,7 +200,7 @@ describe ChefDK::Command::Undelete do
200
200
  Error: Failed to undelete.
201
201
  Reason: (StandardError) some operation failed
202
202
 
203
- E
203
+ E
204
204
 
205
205
  expect(ui.output).to eq(expected_output)
206
206
  end
@@ -216,7 +216,7 @@ E
216
216
  Reason: (StandardError) some operation failed
217
217
 
218
218
 
219
- E
219
+ E
220
220
  expected_output << backtrace.join("\n") << "\n"
221
221
 
222
222
  expect(ui.output).to eq(expected_output)
@@ -174,7 +174,7 @@ describe ChefDK::Command::Update do
174
174
  Error: install failed
175
175
  Reason: (StandardError) some operation failed
176
176
 
177
- E
177
+ E
178
178
 
179
179
  command.run
180
180
  expect(ui.output).to eq(expected_error_text)
@@ -190,7 +190,7 @@ E
190
190
  Reason: (StandardError) some operation failed
191
191
 
192
192
 
193
- E
193
+ E
194
194
 
195
195
  expected_error_text << backtrace.join("\n") << "\n"
196
196
 
@@ -252,7 +252,7 @@ E
252
252
  Error: Failed to update Policyfile lock
253
253
  Reason: (StandardError) some operation failed
254
254
 
255
- E
255
+ E
256
256
 
257
257
  command.run
258
258
  expect(ui.output).to eq(expected_error_text)
@@ -268,7 +268,7 @@ E
268
268
  Reason: (StandardError) some operation failed
269
269
 
270
270
 
271
- E
271
+ E
272
272
 
273
273
  expected_error_text << backtrace.join("\n") << "\n"
274
274
 
@@ -59,7 +59,7 @@ describe ChefDK::Policyfile::ChefServerLockFetcher do
59
59
  }
60
60
  }
61
61
  }
62
- E
62
+ E
63
63
  end
64
64
 
65
65
  def minimal_lockfile
@@ -57,7 +57,7 @@ describe "Policyfile Comparison Bases" do
57
57
  }
58
58
  }
59
59
  }
60
- E
60
+ E
61
61
  end
62
62
 
63
63
  let(:minimal_lockfile) { FFI_Yajl::Parser.parse(minimal_lockfile_json) }
@@ -285,7 +285,7 @@ describe ChefDK::Policyfile::Differ do
285
285
  it "reports that there are no updates" do
286
286
  expected_message = <<~E
287
287
  No changes for policy lock 'jenkins' between 'git: HEAD' and 'local disk'
288
- E
288
+ E
289
289
  differ.run_report
290
290
  expect(output).to include(expected_message)
291
291
  end
@@ -334,7 +334,7 @@ E
334
334
  +recipe[two::two]
335
335
  +recipe[three::three]
336
336
 
337
- E
337
+ E
338
338
  differ.run_report
339
339
  expect(output).to eq(expected_message)
340
340
  end
@@ -391,7 +391,7 @@ E
391
391
  +recipe[q::new]
392
392
  +recipe[r::new]
393
393
 
394
- E
394
+ E
395
395
  differ.run_report
396
396
  expect(output).to eq(expected_message)
397
397
  end
@@ -451,7 +451,7 @@ E
451
451
  - }
452
452
  -}
453
453
 
454
- E
454
+ E
455
455
  differ.run_report
456
456
  expect(output).to eq(expected_message)
457
457
  end
@@ -524,7 +524,7 @@ E
524
524
  + }
525
525
  +}
526
526
 
527
- E
527
+ E
528
528
  differ.run_report
529
529
  expect(output).to eq(expected_message)
530
530
  end
@@ -584,7 +584,7 @@ E
584
584
  "cache_key": null,
585
585
  "scm_info": {
586
586
 
587
- E
587
+ E
588
588
  differ.run_report
589
589
  expect(output).to eq(expected_message)
590
590
  end
@@ -630,7 +630,7 @@ E
630
630
  + "new_attr": "hello"
631
631
  }
632
632
 
633
- E
633
+ E
634
634
  differ.run_report
635
635
  expect(output).to eq(expected_output)
636
636
  end
@@ -676,7 +676,7 @@ E
676
676
  + "new_attr": "ALL THE DIFF"
677
677
  }
678
678
 
679
- E
679
+ E
680
680
 
681
681
  differ.run_report
682
682
  expect(output).to eq(expected_output)
@@ -78,7 +78,7 @@ describe ChefDK::Policyfile::GitLockFetcher do
78
78
  let(:minimal_lockfile_modified) do
79
79
  minimal_lockfile.tap do |lockfile|
80
80
  lockfile["cookbook_locks"][cookbook_name]["source_options"] = {
81
- "git" => repo,
81
+ "git" => repo,
82
82
  "revision" => git_revision,
83
83
  }
84
84
  end
@@ -87,11 +87,11 @@ describe ChefDK::Policyfile::GitLockFetcher do
87
87
  let(:minimal_lockfile_with_scm_info) do
88
88
  minimal_lockfile_modified.tap do |lockfile|
89
89
  lockfile["cookbook_locks"][cookbook_name]["scm_info"] = {
90
- "scm" => "git",
91
- "remote" => repo,
92
- "revision" => git_revision,
93
- "working_tree_clean" => true,
94
- "published" => true,
90
+ "scm" => "git",
91
+ "remote" => repo,
92
+ "revision" => git_revision,
93
+ "working_tree_clean" => true,
94
+ "published" => true,
95
95
  "synchronized_remote_branches" => [
96
96
  "origin/master",
97
97
  ],
@@ -101,7 +101,7 @@ describe ChefDK::Policyfile::GitLockFetcher do
101
101
 
102
102
  let(:source_options) do
103
103
  {
104
- git: repo,
104
+ git: repo,
105
105
  revision: git_revision,
106
106
  }
107
107
  end
@@ -142,7 +142,7 @@ describe ChefDK::Policyfile::GitLockFetcher do
142
142
  relative_path_fetcher.lock_data["cookbook_locks"][cookbook_name]["source_options"]
143
143
  ).to match(
144
144
  {
145
- "git" => repo,
145
+ "git" => repo,
146
146
  "revision" => git_revision,
147
147
  }
148
148
  )
@@ -57,7 +57,7 @@ describe ChefDK::Policyfile::LocalLockFetcher do
57
57
  }
58
58
  }
59
59
  }
60
- E
60
+ E
61
61
  end
62
62
 
63
63
  def minimal_lockfile
@@ -85,7 +85,7 @@ describe ChefDK::Policyfile::Reports::Upload do
85
85
  Using a-longer-named-cookbook 1.0.0 (e4ac353b)
86
86
  Uploaded foo 1.2.42 (cb61daeb)
87
87
  Uploaded barbazqux 12.34.5678 (1241ea6f)
88
- E
88
+ E
89
89
  expect(ui.output).to eq(expected_output)
90
90
  end
91
91
 
@@ -307,7 +307,7 @@ describe ChefDK::PolicyfileCompiler, "when expressing the Policyfile graph deman
307
307
 
308
308
  You may have specified an incorrect recipe in your run list,
309
309
  or this recipe may not be available in that version of the cookbook
310
- MESSAGE
310
+ MESSAGE
311
311
 
312
312
  expect { policyfile.install }.to raise_error do |e|
313
313
  expect(e).to be_a(ChefDK::CookbookDoesNotContainRequiredRecipe)
@@ -338,7 +338,7 @@ MESSAGE
338
338
 
339
339
  You may have specified an incorrect recipe in your run list,
340
340
  or this recipe may not be available in that version of the cookbook
341
- MESSAGE
341
+ MESSAGE
342
342
 
343
343
  expect { policyfile.install }.to raise_error do |e|
344
344
  expect(e).to be_a(ChefDK::CookbookDoesNotContainRequiredRecipe)
@@ -371,7 +371,7 @@ MESSAGE
371
371
 
372
372
  You may have specified an incorrect recipe in your run list,
373
373
  or this recipe may not be available in that version of the cookbook
374
- MESSAGE
374
+ MESSAGE
375
375
 
376
376
  expect { policyfile.install }.to raise_error do |e|
377
377
  expect(e).to be_a(ChefDK::CookbookDoesNotContainRequiredRecipe)
@@ -1063,7 +1063,7 @@ MESSAGE
1063
1063
  default_source :supermarket, "https://supermarket.chef.io" do |s|
1064
1064
  s.preferred_for "remote-cb", "remote-cb-two"
1065
1065
  end
1066
- ERROR
1066
+ ERROR
1067
1067
 
1068
1068
  expect { policyfile.remote_artifacts_graph }.to raise_error do |error|
1069
1069
  expect(error).to be_a(ChefDK::CookbookSourceConflict)
@@ -1165,7 +1165,7 @@ ERROR
1165
1165
  default_source :supermarket, "https://supermarket.chef.io" do |s|
1166
1166
  s.preferred_for "remote-cb-two"
1167
1167
  end
1168
- ERROR
1168
+ ERROR
1169
1169
 
1170
1170
  expect { policyfile.remote_artifacts_graph }.to raise_error do |error|
1171
1171
  expect(error).to be_a(ChefDK::CookbookSourceConflict)