knife 18.4.2 → 18.5.0

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
  SHA256:
3
- metadata.gz: fdf20084b258549d98683a30f13e82c8c05ef96454c04108db37f1a2a5a71182
4
- data.tar.gz: 0cae6131e1d8c5b05547b1f221942e84f501b0ce9685f162e308af8b868c16df
3
+ metadata.gz: d7dbcf835eedd6dece43282604cd9c7136ba0adf6375c856582860700d65031e
4
+ data.tar.gz: bc342db29c4bb913525ff031519efaa585a0067e1ae65bb2786403edef3934f9
5
5
  SHA512:
6
- metadata.gz: 5c1ff58d3324c77d44cd1168bad50e7fa94abf3be2eda9bdd8a39708b41e89f054a3b1113889c38f118adf8d85c75289f9443d3dba0675e2121ff530a645ba84
7
- data.tar.gz: e3d0a3749aa738b7e1cb69793af8bff04a3d209442f58d0f4bdbacbcd4484b1222ce240eae440f45dbd537c73768d86bdcc0d22e4a4e0c36824382ee0b00000b
6
+ metadata.gz: 11a5c1d4e9449e7e566ba18ca38efda979c2341ecba1e07b607a90c7c18acc57af69115039757a3cdb48059c08468d38c75c65f5a28953863c5d8228337d3378
7
+ data.tar.gz: baa24762c6c61cc695ccd0f8fcba24284aab84502dbd2c74f26d436912d66ce7e2119edc401d5071c1577ce77d2b5c08da2eaa145738a4871f18a139d79da609
data/Gemfile CHANGED
@@ -4,7 +4,8 @@ gem "knife", path: "."
4
4
 
5
5
  group(:development, :test) do
6
6
  gem "cheffish", ">= 14" # testing only , but why didn't this need to explicit in chef?
7
- gem "webmock" # testing only
7
+ gem "webmock"
8
+ gem "crack", "< 0.4.6" # due to https://github.com/jnunemaker/crack/pull/75
8
9
  gem "rake"
9
10
  gem "rspec"
10
11
  gem "chef-bin", path: "../chef-bin"
@@ -112,7 +112,7 @@ class Chef
112
112
  end
113
113
  # Use the original path because we can't be sure.
114
114
  inferred_path = arg
115
- elsif arg[0, 1] == "~"
115
+ elsif arg.start_with?("~")
116
116
  # Let's be nice and fix it if possible - but warn the user.
117
117
  ui.warn("A path relative to a user home directory has been provided: #{arg}")
118
118
  ui.warn("Paths provided need to be rooted at the chef-repo being considered or be relative paths.")
@@ -160,7 +160,7 @@ class Chef
160
160
 
161
161
  #
162
162
  # Utility function for finding an element in a hash given an array
163
- # of words and a separator. We find the the longest key in the
163
+ # of words and a separator. We find the longest key in the
164
164
  # hash composed of the given words joined by the separator.
165
165
  #
166
166
  def find_longest_key(hash, words, sep = "_")
@@ -17,7 +17,7 @@
17
17
  class Chef
18
18
  class Knife
19
19
  KNIFE_ROOT = File.expand_path("../..", __dir__)
20
- VERSION = "18.4.2".freeze
20
+ VERSION = "18.5.0".freeze
21
21
  end
22
22
  end
23
23
 
data/lib/chef/knife.rb CHANGED
@@ -414,16 +414,20 @@ class Chef
414
414
  def apply_computed_config
415
415
  Chef::Config[:color] = config[:color]
416
416
 
417
- case Chef::Config[:verbosity]
418
- when 0, nil
419
- Chef::Config[:log_level] = :warn
420
- when 1
421
- Chef::Config[:log_level] = :info
422
- when 2
423
- Chef::Config[:log_level] = :debug
424
- else
425
- Chef::Config[:log_level] = :trace
426
- end
417
+ # If the verbosity is not set, use what is already present on the log_level config.
418
+ Chef::Config[:log_level] = case Chef::Config[:verbosity]
419
+ when 0
420
+ :warn
421
+ when 1
422
+ :info
423
+ when 2
424
+ :debug
425
+ when nil
426
+ # The default log_level is auto and that is not a valid log_level.
427
+ Chef::Config[:log_level] == :auto ? :warn : Chef::Config[:log_level]
428
+ else
429
+ :trace
430
+ end
427
431
 
428
432
  Chef::Config[:log_level] = :trace if ENV["KNIFE_DEBUG"]
429
433
 
@@ -105,7 +105,7 @@ describe Chef::Knife::SubcommandLoader::HashedCommandLoader do
105
105
  expect(loader.subcommand_for_args(%w{cooler b})).to eq("cooler_b")
106
106
  end
107
107
 
108
- it "returns nil if the the subcommand isn't in our manifest" do
108
+ it "returns nil if the subcommand isn't in our manifest" do
109
109
  expect(loader.subcommand_for_args(["cooler c"])).to eq(nil)
110
110
  end
111
111
  end
@@ -320,6 +320,9 @@ describe Chef::Knife do
320
320
  end
321
321
 
322
322
  it "sets the default log_level to warn so we can issue Chef::Log.warn" do
323
+ # Reset the log level to the default value
324
+ Chef::Config[:log_level] = :auto
325
+
323
326
  knife_command = KnifeSpecs::TestYourself.new([])
324
327
  knife_command.configure_chef
325
328
  expect(Chef::Config[:log_level]).to eql(:warn)
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: 18.4.2
4
+ version: 18.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-30 00:00:00.000000000 Z
11
+ date: 2024-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -1145,7 +1145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1145
1145
  - !ruby/object:Gem::Version
1146
1146
  version: '0'
1147
1147
  requirements: []
1148
- rubygems_version: 3.2.33
1148
+ rubygems_version: 3.3.26
1149
1149
  signing_key:
1150
1150
  specification_version: 4
1151
1151
  summary: The knife CLI for Chef Infra.