knife 17.1.35 → 17.2.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -5
- data/knife.gemspec +2 -1
- data/lib/chef/knife/configure.rb +1 -1
- data/lib/chef/knife/org_user_add.rb +1 -1
- data/lib/chef/knife/ssl_fetch.rb +1 -1
- data/lib/chef/knife/version.rb +1 -1
- data/spec/integration/commands_spec.rb +55 -0
- metadata +19 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c59d8d9f4d2b9c07749f19f302a444f81c8e4f18c1a9d975664339f491ab6a10
|
4
|
+
data.tar.gz: b66856e635b5af7e45ba80af0d2f9f6e13736ba8000dd82d1953864f20be9640
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5825020630a1925537d2bf81c504f46e2370f4c6895668ff4b482fe8d16f6b0970bf8b4e93cd560f11d2a14ff68ddd5c125fcd232a8d7e312f5de05327722105
|
7
|
+
data.tar.gz: 4655fd4e97b9bfcf06609063a6f58cbe2fac3c8f1f73d61c7890e74dfe15480f4fd9f01a9543776f8019087f55afa52433347283239001bc20ef18a4da7d331a
|
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,13 @@ 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.
|
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
|
+
s.add_dependency "x25519" # ed25519 KEX module
|
33
34
|
s.add_dependency "highline", ">= 1.6.9", "< 3" # Used in UI to present a list, no other usage.
|
34
35
|
|
35
36
|
s.add_dependency "tty-prompt", "~> 0.21" # knife ui.ask prompt
|
data/lib/chef/knife/configure.rb
CHANGED
@@ -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"
|
data/lib/chef/knife/ssl_fetch.rb
CHANGED
@@ -28,7 +28,7 @@ class Chef
|
|
28
28
|
require "socket" unless defined?(Socket)
|
29
29
|
require "uri" unless defined?(URI)
|
30
30
|
require "openssl" unless defined?(OpenSSL)
|
31
|
-
require "chef/mixin/
|
31
|
+
require "chef/mixin/proxified_socket" unless defined?(Chef::Mixin::ProxifiedSocket)
|
32
32
|
|
33
33
|
include Chef::Mixin::ProxifiedSocket
|
34
34
|
end
|
data/lib/chef/knife/version.rb
CHANGED
@@ -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.
|
4
|
+
version: 17.2.38
|
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-
|
11
|
+
date: 2021-06-15 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.
|
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.
|
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
|
@@ -262,6 +256,20 @@ dependencies:
|
|
262
256
|
- - "~>"
|
263
257
|
- !ruby/object:Gem::Version
|
264
258
|
version: '1.1'
|
259
|
+
- !ruby/object:Gem::Dependency
|
260
|
+
name: x25519
|
261
|
+
requirement: !ruby/object:Gem::Requirement
|
262
|
+
requirements:
|
263
|
+
- - ">="
|
264
|
+
- !ruby/object:Gem::Version
|
265
|
+
version: '0'
|
266
|
+
type: :runtime
|
267
|
+
prerelease: false
|
268
|
+
version_requirements: !ruby/object:Gem::Requirement
|
269
|
+
requirements:
|
270
|
+
- - ">="
|
271
|
+
- !ruby/object:Gem::Version
|
272
|
+
version: '0'
|
265
273
|
- !ruby/object:Gem::Dependency
|
266
274
|
name: highline
|
267
275
|
requirement: !ruby/object:Gem::Requirement
|
@@ -956,6 +964,7 @@ files:
|
|
956
964
|
- spec/integration/client_key_show_spec.rb
|
957
965
|
- spec/integration/client_list_spec.rb
|
958
966
|
- spec/integration/client_show_spec.rb
|
967
|
+
- spec/integration/commands_spec.rb
|
959
968
|
- spec/integration/common_options_spec.rb
|
960
969
|
- spec/integration/config_list_spec.rb
|
961
970
|
- spec/integration/config_show_spec.rb
|