knife 17.9.9 → 17.9.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/knife/acl_bulk_add.rb +1 -1
- data/lib/chef/knife/acl_bulk_remove.rb +1 -1
- data/lib/chef/knife/bootstrap.rb +2 -3
- data/lib/chef/knife/core/gem_glob_loader.rb +1 -1
- data/lib/chef/knife/core/generic_presenter.rb +1 -1
- data/lib/chef/knife/core/subcommand_loader.rb +2 -2
- data/lib/chef/knife/version.rb +1 -1
- data/spec/knife_spec_helper.rb +2 -2
- data/spec/support/platform_helpers.rb +1 -1
- data/spec/unit/knife/environment_list_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38b44d2b8c6f86ac93d2803ec55b87fc55d63e5de3c3cd167f4495fe54dd1fb0
|
4
|
+
data.tar.gz: aaf3fc0aba59a4d1e38d6df2098053c4b3c12d4f4aca84e62ca1d338717c5fc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc6634edc2cd46990071712a5660883babe15c70d96426b4c32e2a66a885026c5a0fc9a087cd0336944d63f1b3919e5755e903ed83cbd5f0d97c456d6eb35a78
|
7
|
+
data.tar.gz: 935ff218ca8290c8cf384faea1dfc42c19704b993922ad40755067fca5798a7199e8c57fab84ceebd8f7f0645a2c040cb211dc0d36334f5027162233add2877d
|
@@ -56,7 +56,7 @@ class Chef
|
|
56
56
|
|
57
57
|
objects_to_modify = []
|
58
58
|
all_objects = rest.get_rest(object_type)
|
59
|
-
objects_to_modify = all_objects.keys.
|
59
|
+
objects_to_modify = all_objects.keys.grep(object_name_matcher)
|
60
60
|
|
61
61
|
if objects_to_modify.empty?
|
62
62
|
ui.info "No #{object_type} match the expression /#{regex}/"
|
@@ -61,7 +61,7 @@ class Chef
|
|
61
61
|
|
62
62
|
objects_to_modify = []
|
63
63
|
all_objects = rest.get_rest(object_type)
|
64
|
-
objects_to_modify = all_objects.keys.
|
64
|
+
objects_to_modify = all_objects.keys.grep(object_name_matcher)
|
65
65
|
|
66
66
|
if objects_to_modify.empty?
|
67
67
|
ui.info "No #{object_type} match the expression /#{regex}/"
|
data/lib/chef/knife/bootstrap.rb
CHANGED
@@ -20,6 +20,7 @@ require_relative "../knife"
|
|
20
20
|
require_relative "data_bag_secret_options"
|
21
21
|
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
22
22
|
require "license_acceptance/cli_flags/mixlib_cli"
|
23
|
+
require "chef/json_compat" unless defined?(Chef::JSONCompat) # can't be lazy loaded since it's used in options
|
23
24
|
|
24
25
|
module LicenseAcceptance
|
25
26
|
autoload :Acceptor, "license_acceptance/acceptor"
|
@@ -416,9 +417,6 @@ class Chef
|
|
416
417
|
attr_reader :connection
|
417
418
|
|
418
419
|
deps do
|
419
|
-
require "erubis" unless defined?(Erubis)
|
420
|
-
require "net/ssh" unless defined?(Net::SSH)
|
421
|
-
require "chef/json_compat" unless defined?(Chef::JSONCompat)
|
422
420
|
require "chef-config/path_helper" unless defined?(ChefConfig::PathHelper)
|
423
421
|
require_relative "bootstrap/chef_vault_handler"
|
424
422
|
require_relative "bootstrap/client_builder"
|
@@ -544,6 +542,7 @@ class Chef
|
|
544
542
|
end
|
545
543
|
|
546
544
|
def render_template
|
545
|
+
require "erubis" unless defined?(Erubis)
|
547
546
|
@config[:first_boot_attributes] = first_boot_attributes
|
548
547
|
template_file = find_template
|
549
548
|
template = IO.read(template_file).chomp
|
@@ -62,7 +62,7 @@ class Chef
|
|
62
62
|
|
63
63
|
# Exclude knife/chef/version. It's not a knife command, and force-loading
|
64
64
|
# when we load all of these files will emit constant-already-defined warnings
|
65
|
-
next if rel_path
|
65
|
+
next if rel_path&.match?(version_file_match)
|
66
66
|
|
67
67
|
subcommand_files[rel_path] = file
|
68
68
|
end
|
@@ -151,7 +151,7 @@ class Chef
|
|
151
151
|
rel_path = knife_file[/#{KNIFE_ROOT}#{Regexp.escape(File::SEPARATOR)}(.*)\.rb/, 1]
|
152
152
|
# Exclude version.rb file for the gem. It's not a knife command, and force-loading it later
|
153
153
|
# because loaded via in subcommand files generates CLI warnings about its consts already having been defined
|
154
|
-
next if knife_file
|
154
|
+
next if knife_file&.match?(version_file_match)
|
155
155
|
|
156
156
|
subcommand_files[rel_path] = knife_file
|
157
157
|
end
|
@@ -184,7 +184,7 @@ class Chef
|
|
184
184
|
# @return [Array<String>]
|
185
185
|
#
|
186
186
|
def positional_arguments(args)
|
187
|
-
args.
|
187
|
+
args.grep(/^(([[:alnum:]])[[:alnum:]\_\-]+)$/)
|
188
188
|
end
|
189
189
|
|
190
190
|
# Returns an Array of paths to knife commands located in
|
data/lib/chef/knife/version.rb
CHANGED
data/spec/knife_spec_helper.rb
CHANGED
@@ -78,8 +78,8 @@ require "spec/support/shared/matchers/match_environment_variable"
|
|
78
78
|
# Excludes support/platforms by default
|
79
79
|
# Do not change the gsub.
|
80
80
|
Dir["spec/support/**/*.rb"]
|
81
|
-
.
|
82
|
-
.
|
81
|
+
.grep_v(%r{^spec/support/platforms})
|
82
|
+
.grep_v(%r{^spec/support/pedant})
|
83
83
|
.map { |f| f.gsub(/.rb$/, "") }
|
84
84
|
.map { |f| f.gsub(%r{spec/}, "") }
|
85
85
|
.each { |f| require f }
|
@@ -39,7 +39,7 @@ describe Chef::Knife::EnvironmentList do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should print the environment names in a sorted list" do
|
42
|
-
names = @environments.keys.sort
|
42
|
+
names = @environments.keys.sort
|
43
43
|
expect(@knife).to receive(:output).with(names)
|
44
44
|
@knife.run
|
45
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 17.9.
|
4
|
+
version: 17.9.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|