chef 13.10.4 → 13.11.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07f498ba61d7d87850edd566e87e5942aee2480c
4
- data.tar.gz: 0faa34027b9c99b7ca406925b0da04b8d7fc4b6c
3
+ metadata.gz: 8880a5eff343534ec15cf535f23cc1a0fba4a3a2
4
+ data.tar.gz: f23ad02185380f751ed8518a56ac1e8b65cb4353
5
5
  SHA512:
6
- metadata.gz: 78d41a3824835af322fd9657639e49db6db2d41e0ed59add5a661af8ae498495b0c8b411f80d79e2447447a23d3d84aca8d66da75f442e4c160ce3bfae9977e6
7
- data.tar.gz: 043a6e1077f34577914b6217454d07b8ed2bc82e65db65c84f59c1d1465baf866dc1e8cea6f5440ce6e073aadd675b52015c8cdfee7248ab48ee14ac8aa4cf3c
6
+ metadata.gz: 539613d5ddc0642095c1f8ffd5c0b21283af2e8de49969c5ed86d3d29e9c6166a21cdbefefd2e261aeb026820dba01251e175726a345a1fe6a04d275b22674ff
7
+ data.tar.gz: aada4a0350fabba8d693858688285550a5d482a4ce9c596ca112305116c2c682a525bcbf6bcd7e4218d2439913995649f523c2059e7e043c36ad5d9263aac8bf
data/VERSION CHANGED
@@ -1 +1 @@
1
- 13.10.4
1
+ 13.11.3
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.add_dependency "mixlib-cli", "~> 1.7"
21
21
  s.add_dependency "mixlib-log", "~> 1.3"
22
22
  s.add_dependency "mixlib-authentication", "~> 1.4"
23
- s.add_dependency "mixlib-shellout", "~> 2.0"
23
+ s.add_dependency "mixlib-shellout", "~> 2.4"
24
24
  s.add_dependency "mixlib-archive", "~> 0.4"
25
25
  s.add_dependency "ohai", "~> 13.0"
26
26
 
@@ -301,9 +301,9 @@ class Chef
301
301
  # we're just going to make cookbook_files out of these and make the
302
302
  # cookbook find them by filespecificity again. but it's the shortest
303
303
  # path to "success" for now.
304
- if manifest_record_path =~ /(#{Regexp.escape(segment.to_s)}\/[^\/]+\/#{Regexp.escape(dirname)})\/.+$/
304
+ if manifest_record_path =~ /(#{Regexp.escape(segment.to_s)}\/[^\/]*\/?#{Regexp.escape(dirname)})\/.+$/
305
305
  specificity_dirname = $1
306
- non_specific_path = manifest_record_path[/#{Regexp.escape(segment.to_s)}\/[^\/]+\/#{Regexp.escape(dirname)}\/(.+)$/, 1]
306
+ non_specific_path = manifest_record_path[/#{Regexp.escape(segment.to_s)}\/[^\/]*\/?#{Regexp.escape(dirname)}\/(.+)$/, 1]
307
307
  # Record the specificity_dirname only if it's in the list of
308
308
  # valid preferences
309
309
  if filenames_by_pref[specificity_dirname]
@@ -420,10 +420,11 @@ class Chef
420
420
  exit 1
421
421
  elsif server_name == "windows"
422
422
  # catches "knife bootstrap windows" when that command is not installed
423
- ui.warn("Hostname containing 'windows' specified. Please install 'knife-windows' if you are attempting to bootstrap a Windows node via WinRM.")
423
+ ui.warn("'knife bootstrap windows' specified, but the knife-windows plugin is not installed. Please install 'knife-windows' if you are attempting to bootstrap a Windows node via WinRM.")
424
424
  end
425
425
  end
426
426
 
427
+ # make sure policyfile values are set correctly
427
428
  def validate_options!
428
429
  if incomplete_policyfile_options?
429
430
  ui.error("--policy-name and --policy-group must be specified together")
@@ -435,6 +436,9 @@ class Chef
435
436
  true
436
437
  end
437
438
 
439
+ # setup a Chef::Knife::Ssh object using the passed config options
440
+ #
441
+ # @return Chef::Knife::Ssh
438
442
  def knife_ssh
439
443
  ssh = Chef::Knife::Ssh.new
440
444
  ssh.ui = ui
@@ -452,6 +456,10 @@ class Chef
452
456
  ssh
453
457
  end
454
458
 
459
+ # prompt for a password then return a knife ssh object with that password set
460
+ # and with ssh_identity_file set to nil
461
+ #
462
+ # @return Chef::Knife::Ssh
455
463
  def knife_ssh_with_password_auth
456
464
  ssh = knife_ssh
457
465
  ssh.config[:ssh_identity_file] = nil
@@ -459,6 +467,8 @@ class Chef
459
467
  ssh
460
468
  end
461
469
 
470
+ # build the ssh dommand for bootrapping
471
+ # @return String
462
472
  def ssh_command
463
473
  command = render_template
464
474
 
@@ -188,14 +188,14 @@ class Chef
188
188
  end
189
189
 
190
190
  def install_profile(profile_path)
191
- cmd = "profiles -I -F '#{profile_path}'"
191
+ cmd = "/usr/bin/profiles -I -F '#{profile_path}'"
192
192
  Chef::Log.debug("cmd: #{cmd}")
193
193
  shellout_results = shell_out(cmd)
194
194
  shellout_results.exitstatus
195
195
  end
196
196
 
197
197
  def remove_profile
198
- cmd = "profiles -R -p '#{@new_profile_identifier}'"
198
+ cmd = "/usr/bin/profiles -R -p '#{@new_profile_identifier}'"
199
199
  Chef::Log.debug("cmd: #{cmd}")
200
200
  shellout_results = shell_out(cmd)
201
201
  shellout_results.exitstatus
@@ -225,7 +225,7 @@ class Chef
225
225
  end
226
226
 
227
227
  def write_installed_profiles(tempfile)
228
- cmd = "profiles -P -o '#{tempfile}'"
228
+ cmd = "/usr/bin/profiles -P -o '#{tempfile}'"
229
229
  shell_out!(cmd)
230
230
  end
231
231
 
@@ -480,7 +480,7 @@ class Chef
480
480
  elsif current_version.nil?
481
481
  Chef::Log.debug("#{new_resource} has no existing installed version. Installing install #{candidate_version}")
482
482
  target_version_array.push(candidate_version)
483
- elsif version_compare(current_version, candidate_version) == 1 && !new_resource.allow_downgrade
483
+ elsif version_compare(current_version, candidate_version) == 1 && !allow_downgrade
484
484
  Chef::Log.debug("#{new_resource} #{package_name} has installed version #{current_version}, which is newer than available version #{candidate_version}. Skipping...)")
485
485
  target_version_array.push(nil)
486
486
  else
@@ -229,6 +229,7 @@ class Chef
229
229
  r.timeout(new_resource.timeout)
230
230
  r.returns(new_resource.returns)
231
231
  r.options(new_resource.options)
232
+ r.sensitive(new_resource.sensitive)
232
233
  end
233
234
  end
234
235
 
@@ -62,7 +62,7 @@ class Chef
62
62
  unattended_flags,
63
63
  expand_options(new_resource.options),
64
64
  "& exit %%%%ERRORLEVEL%%%%",
65
- ].join(" "), timeout: new_resource.timeout, returns: new_resource.returns
65
+ ].join(" "), timeout: new_resource.timeout, returns: new_resource.returns, sensitive: new_resource.sensitive
66
66
  )
67
67
  end
68
68
 
@@ -74,7 +74,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service
74
74
  }.reject { |k, v| v.nil? || v.length == 0 }
75
75
 
76
76
  Win32::Service.configure(new_config)
77
- Chef::Log.info "#{@new_resource} configured with #{new_config.inspect}"
77
+ Chef::Log.info "#{@new_resource} configured."
78
78
 
79
79
  if new_config.has_key?(:service_start_name)
80
80
  unless Chef::ReservedNames::Win32::Security.get_account_right(canonicalize_username(new_config[:service_start_name])).include?(SERVICE_RIGHT)
@@ -23,7 +23,7 @@ require "chef/version_string"
23
23
 
24
24
  class Chef
25
25
  CHEF_ROOT = File.expand_path("../..", __FILE__)
26
- VERSION = Chef::VersionString.new("13.10.4")
26
+ VERSION = Chef::VersionString.new("13.11.3")
27
27
  end
28
28
 
29
29
  #
@@ -94,11 +94,18 @@ describe Chef::CookbookVersion, "file specificity" do
94
94
 
95
95
  # directory adirectory
96
96
  {
97
- :name => "files/anotherfile1.rb",
98
- :path => "files/host-examplehost.example.org/adirectory/anotherfile1.rb.host",
99
- :full_path => "/cookbook-folder/files/host-examplehost.example.org/adirectory/anotherfile1.rb.host",
100
- :checksum => "csum-host-1",
101
- :specificity => "host-examplehost.example.org",
97
+ name: "files/anotherfile1.rb",
98
+ path: "files/root_directory/anotherfile1.rb.root",
99
+ checksum: "csum-root-directory",
100
+ specificity: "root_directory",
101
+ },
102
+
103
+ {
104
+ name: "files/anotherfile1.rb",
105
+ path: "files/host-examplehost.example.org/adirectory/anotherfile1.rb.host",
106
+ full_path: "/cookbook-folder/files/host-examplehost.example.org/adirectory/anotherfile1.rb.host",
107
+ checksum: "csum-host-1",
108
+ specificity: "host-examplehost.example.org",
102
109
  },
103
110
  {
104
111
  :name => "files/anotherfile2.rb",
@@ -483,6 +490,19 @@ describe Chef::CookbookVersion, "file specificity" do
483
490
  ## Globbing the relative paths out of the manifest records ##
484
491
 
485
492
  describe "when globbing for relative file paths based on filespecificity" do
493
+ it "should return a list of relative paths based on priority preference: root directory" do
494
+ node = Chef::Node.new
495
+ node.automatic_attrs[:platform] = "ubuntu"
496
+ node.automatic_attrs[:platform_version] = "9.10"
497
+ node.automatic_attrs[:fqdn] = "examplehost.example.org"
498
+
499
+ filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "root_directory")
500
+ expect(filenames).not_to be_nil
501
+ expect(filenames.size).to eq(1)
502
+
503
+ expect(filenames.sort).to eq(["anotherfile1.rb.root"])
504
+ end
505
+
486
506
  it "should return a list of relative paths based on priority preference: host" do
487
507
  node = Chef::Node.new
488
508
  node.automatic_attrs[:platform] = "ubuntu"
@@ -116,7 +116,7 @@ describe Chef::Provider::OsxProfile do
116
116
  allow(provider).to receive(:generate_tempfile).and_return(tempfile)
117
117
  allow(provider).to receive(:get_installed_profiles).and_call_original
118
118
  allow(provider).to receive(:read_plist).and_return(all_profiles)
119
- expect(provider).to receive(:shell_out!).with("profiles -P -o '/tmp/allprofiles.plist'")
119
+ expect(provider).to receive(:shell_out!).with("/usr/bin/profiles -P -o '/tmp/allprofiles.plist'")
120
120
  provider.load_current_resource
121
121
  end
122
122
 
@@ -164,7 +164,7 @@ describe Chef::Provider::OsxProfile do
164
164
  all_profiles["_computerlevel"][1]["ProfileUUID"] = "1781fbec-3325-565f-9022-9bb39245d4dd"
165
165
  provider.load_current_resource
166
166
  allow(provider).to receive(:write_profile_to_disk).and_return(profile_path)
167
- expect(provider).to receive(:shell_out).with("profiles -I -F '#{profile_path}'").and_return(shell_out_success)
167
+ expect(provider).to receive(:shell_out).with("/usr/bin/profiles -I -F '#{profile_path}'").and_return(shell_out_success)
168
168
  provider.action_install()
169
169
  end
170
170
 
@@ -248,7 +248,7 @@ describe Chef::Provider::OsxProfile do
248
248
  new_resource.identifier "com.testprofile.screensaver"
249
249
  new_resource.action(:remove)
250
250
  provider.load_current_resource
251
- expect(provider).to receive(:shell_out).with("profiles -R -p '#{new_resource.identifier}'").and_return(shell_out_success)
251
+ expect(provider).to receive(:shell_out).with("/usr/bin/profiles -R -p '#{new_resource.identifier}'").and_return(shell_out_success)
252
252
  provider.action_remove()
253
253
  end
254
254
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.10.4
4
+ version: 13.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-08 00:00:00.000000000 Z
11
+ date: 2018-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 13.10.4
19
+ version: 13.11.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 13.10.4
26
+ version: 13.11.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mixlib-cli
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.0'
75
+ version: '2.4'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '2.0'
82
+ version: '2.4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mixlib-archive
85
85
  requirement: !ruby/object:Gem::Requirement