knife 17.1.40 → 17.3.13

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: 9e0f9783ff2d0be953fc4a5abe1dff544afec80a1ab224bcfe6d3ec9c8c03e22
4
- data.tar.gz: ffb60374998b18a68acadb7caf2607c12ab1bf45abb9e104b06eb2ce6732f088
3
+ metadata.gz: c4910d4e2971cca8a2e720337272d4c5b8b547c15a3d921c35b0691b826a3cbd
4
+ data.tar.gz: 4c9f8242f1370ffbf2fe6c68b6a08166a6b07bc88e9e93402383d1c64a81fe6c
5
5
  SHA512:
6
- metadata.gz: d15ab28f27bd2b3f4c2d87782a7c858c00b20304cfe6f0db2e668f698e303c0c53b29b36b6227f81a093c060bda244b62fe25f20c16341ede744a3e693048828
7
- data.tar.gz: 99adb3e7b45d40d6a8075f0d944e8f057f18516e170dfe904c59932048449cadbc624f9e9e5d101b8344ab9f20e1d2db86d612ffcc16f73a7dd5dd9895734edf
6
+ metadata.gz: 4b1fa6278d191d23b017c2a8eb25d171e8002ab596efa84b8bf9fb699aa03c9aa191960878147b6af4c738f208f987387ce5ed2f1e754c5422742df958c1209f
7
+ data.tar.gz: 4d7fb053ed8aedafb48004c291c5d5b78f327d941c1735d8de49352bc2a5a55ab4a1a1d86aa28b5722a07ea34cda0d3f0a09a6e091d680e784bcc85745ee6af8
data/Gemfile CHANGED
@@ -1,10 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Note we do not use the gemspec DSL which restricts to the
4
- # gemspec for the current platform and filters out other platforms
5
- # during a bundle lock operation. We actually want dependencies from
6
- # both of our gemspecs. Also note this this mimics gemspec behavior
7
- # of bundler versions prior to 1.12.0 (https://github.com/bundler/bundler/commit/193a14fe5e0d56294c7b370a0e59f93b2c216eed)
8
3
  gem "knife", path: "."
9
4
 
10
5
  group(:development, :test) do
data/knife.gemspec CHANGED
@@ -24,12 +24,14 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency "mixlib-cli", ">= 2.1.1", "< 3.0"
25
25
  s.add_dependency "mixlib-archive", ">= 0.4", "< 2.0"
26
26
  s.add_dependency "ohai", "~> 17.0"
27
- s.add_dependency "ffi", ">= 1.9.25", "< 1.14.0" # 1.14 breaks i386 windows. It should be fixed in 1.14.3
27
+ s.add_dependency "ffi", ">= 1.15" # 1.14 versions are broken on i386 windows
28
28
  s.add_dependency "ffi-yajl", "~> 2.2"
29
29
  s.add_dependency "net-ssh", ">= 5.1", "< 7"
30
30
  s.add_dependency "net-ssh-multi", "~> 1.2", ">= 1.2.1"
31
31
  s.add_dependency "ed25519", "~> 1.2" # ed25519 ssh key support
32
32
  s.add_dependency "bcrypt_pbkdf", "~> 1.1" # ed25519 ssh key support
33
+ # we can't use this gem until illegal instruction issues are resolved
34
+ # s.add_dependency "x25519" # ed25519 KEX module
33
35
  s.add_dependency "highline", ">= 1.6.9", "< 3" # Used in UI to present a list, no other usage.
34
36
 
35
37
  s.add_dependency "tty-prompt", "~> 0.21" # knife ui.ask prompt
@@ -29,7 +29,6 @@ class Chef
29
29
  require "chef-config/path_helper" unless defined?(ChefConfig::PathHelper)
30
30
  require_relative "client_create"
31
31
  require_relative "user_create"
32
- require "ohai" unless defined?(Ohai)
33
32
  Chef::Knife::ClientCreate.load_deps
34
33
  Chef::Knife::UserCreate.load_deps
35
34
  end
@@ -131,6 +130,7 @@ class Chef
131
130
 
132
131
  # @return [String] our best guess at what the servername should be using Ohai data and falling back to localhost
133
132
  def guess_servername
133
+ require "ohai" unless defined?(Ohai::System)
134
134
  o = Ohai::System.new
135
135
  o.all_plugins(%w{ os hostname fqdn })
136
136
  o[:fqdn] || o[:machinename] || o[:hostname] || "localhost"
@@ -29,7 +29,7 @@ class Chef
29
29
  description: "Add user to admin group"
30
30
 
31
31
  deps do
32
- require_relative "../org"
32
+ require "chef/org"
33
33
  end
34
34
 
35
35
  def run
@@ -17,7 +17,7 @@
17
17
  class Chef
18
18
  class Knife
19
19
  KNIFE_ROOT = File.expand_path("../..", __dir__)
20
- VERSION = "17.1.40".freeze
20
+ VERSION = "17.3.13".freeze
21
21
  end
22
22
  end
23
23
 
@@ -0,0 +1,55 @@
1
+ #
2
+ # Author:: Marc Pardise (<marc@chef.io>)
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ require "chef/knife"
19
+
20
+ Chef::Knife.subcommand_loader.load_commands
21
+ commands = Chef::Knife::SubcommandLoader.generate_hash["_autogenerated_command_paths"]["plugins_paths"].keys
22
+
23
+ # Directly execute each support knife command
24
+ context "Command Sanity Check: executing ", :workstation do
25
+ describe "bundle exec knife" do
26
+ commands.each do |command|
27
+ command_name = command.gsub("_", " ")
28
+ modified_command, expected_result = case command_name
29
+ when /knife/
30
+ # because rspec is the actual executable running, the option parser error message
31
+ # is invalid from within the test.
32
+ next
33
+ when /config (use|get|list) profile.*/
34
+ # hyphenated special cases
35
+ [command_name, /^USAGE: knife config #{$1}-profile.*/]
36
+ when /(role|node|env) (env )?run list(.*)/
37
+ # underscored special cases...
38
+ env_part = $2.nil? ? "" : "env_"
39
+ ["#{$1} #{$2}run_list#{$3}", /^USAGE: knife #{$1} #{env_part}run_list#{$3}.*/]
40
+ else
41
+ [ command_name, /^USAGE: knife #{command_name}.*/]
42
+ end
43
+
44
+ # By using bundle exec knife instead of directly loading the command class or using the knife() helper,
45
+ # we ensure that this is a valid end-to-end test. This operates on the assumption
46
+ # that we continue to require the command class to be fully loaded so that it can handle the parsing of
47
+ # its own options.
48
+ full_command = "#{modified_command} --invalid-option outputs usage for '#{modified_command}' to stdout"
49
+ it full_command do
50
+ result = `bundle exec knife #{full_command}`
51
+ expect(result).to match(expected_result)
52
+ end
53
+ end
54
+ end
55
+ 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.1.40
4
+ version: 17.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-14 00:00:00.000000000 Z
11
+ date: 2021-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -166,20 +166,14 @@ dependencies:
166
166
  requirements:
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
- version: 1.9.25
170
- - - "<"
171
- - !ruby/object:Gem::Version
172
- version: 1.14.0
169
+ version: '1.15'
173
170
  type: :runtime
174
171
  prerelease: false
175
172
  version_requirements: !ruby/object:Gem::Requirement
176
173
  requirements:
177
174
  - - ">="
178
175
  - !ruby/object:Gem::Version
179
- version: 1.9.25
180
- - - "<"
181
- - !ruby/object:Gem::Version
182
- version: 1.14.0
176
+ version: '1.15'
183
177
  - !ruby/object:Gem::Dependency
184
178
  name: ffi-yajl
185
179
  requirement: !ruby/object:Gem::Requirement
@@ -956,6 +950,7 @@ files:
956
950
  - spec/integration/client_key_show_spec.rb
957
951
  - spec/integration/client_list_spec.rb
958
952
  - spec/integration/client_show_spec.rb
953
+ - spec/integration/commands_spec.rb
959
954
  - spec/integration/common_options_spec.rb
960
955
  - spec/integration/config_list_spec.rb
961
956
  - spec/integration/config_show_spec.rb