knife 17.4.47 → 17.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/knife.gemspec +0 -1
- data/lib/chef/knife/acl_base.rb +1 -1
- data/lib/chef/knife/bootstrap.rb +1 -1
- data/lib/chef/knife/org_user_add.rb +1 -1
- data/lib/chef/knife/org_user_remove.rb +2 -2
- data/lib/chef/knife/version.rb +1 -1
- data/spec/integration/delete_spec.rb +1 -1
- data/spec/integration/download_spec.rb +2 -2
- data/spec/integration/upload_spec.rb +5 -6
- data/spec/unit/knife/bootstrap_spec.rb +10 -10
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3642bb965e5c59528178bdf9ee38bb1a2163587830159d58f72a85fb0d747e75
|
4
|
+
data.tar.gz: 890a3eb24418163b5b4380514cb89b3896deb002d034999206aa42c252697b96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d03a7372abe2fa0d306dbedb0c6cb9d903c8515eeb51c377f5d37a933a4828fed0e9e7e554ef006b3bc767420e9d6e4ff58f9aaa961f9ca62a64fc1075092651
|
7
|
+
data.tar.gz: f582e2289db8c047aff0bdc63e9017f5d535961622e71cbf00d9d89e51d1ae170ab786b0938194439dc98dd35ccd8e956c0d2120fd867d97d5cb3b997d706609
|
data/knife.gemspec
CHANGED
@@ -28,7 +28,6 @@ Gem::Specification.new do |s|
|
|
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
|
-
s.add_dependency "ed25519", "~> 1.2" # ed25519 ssh key support
|
32
31
|
s.add_dependency "bcrypt_pbkdf", "~> 1.1" # ed25519 ssh key support
|
33
32
|
# disabling this until we get get it to compile on RHEL 7
|
34
33
|
# s.add_dependency "x25519", ">= 1.0.9" # ed25519 KEX module. 1.0.9+ required to resolve sigill failures
|
data/lib/chef/knife/acl_base.rb
CHANGED
@@ -25,7 +25,7 @@ class Chef
|
|
25
25
|
|
26
26
|
PERM_TYPES = %w{create read update delete grant}.freeze unless defined? PERM_TYPES
|
27
27
|
MEMBER_TYPES = %w{client group user}.freeze unless defined? MEMBER_TYPES
|
28
|
-
OBJECT_TYPES = %w{clients containers cookbooks data environments groups nodes roles policies policy_groups}.freeze unless defined? OBJECT_TYPES
|
28
|
+
OBJECT_TYPES = %w{clients containers cookbook_artifacts cookbooks data environments groups nodes roles policies policy_groups}.freeze unless defined? OBJECT_TYPES
|
29
29
|
OBJECT_NAME_SPEC = /^[\-[:alnum:]_\.]+$/.freeze unless defined? OBJECT_NAME_SPEC
|
30
30
|
|
31
31
|
def validate_object_type!(type)
|
data/lib/chef/knife/bootstrap.rb
CHANGED
@@ -930,7 +930,7 @@ class Chef
|
|
930
930
|
opts[:logger] = Chef::Log
|
931
931
|
opts[:password] = config[:connection_password] if config.key?(:connection_password)
|
932
932
|
opts[:user] = user if user
|
933
|
-
opts[:max_wait_until_ready] = config[:max_wait].
|
933
|
+
opts[:max_wait_until_ready] = config[:max_wait].to_i unless config[:max_wait].nil?
|
934
934
|
# TODO - when would we need to provide rdp_port vs port? Or are they not mutually exclusive?
|
935
935
|
opts[:port] = port if port
|
936
936
|
end
|
@@ -44,7 +44,7 @@ class Chef
|
|
44
44
|
org = Chef::Org.new(@org_name)
|
45
45
|
begin
|
46
46
|
org.associate_user(@username)
|
47
|
-
rescue Net::
|
47
|
+
rescue Net::HTTPClientException => e
|
48
48
|
if e.response.code == "409"
|
49
49
|
ui.msg "User #{username} already associated with organization #{org_name}"
|
50
50
|
else
|
@@ -60,7 +60,7 @@ class Chef
|
|
60
60
|
|
61
61
|
begin
|
62
62
|
org.dissociate_user(@username)
|
63
|
-
rescue Net::
|
63
|
+
rescue Net::HTTPClientException => e
|
64
64
|
if e.response.code == "404"
|
65
65
|
ui.msg "User #{username} is not associated with organization #{org_name}"
|
66
66
|
exit 1
|
@@ -88,7 +88,7 @@ class Chef
|
|
88
88
|
|
89
89
|
def remove_user_from_admin_group(org, org_name, username, admin_group_string)
|
90
90
|
org.remove_user_from_group(admin_group_string, username)
|
91
|
-
rescue Net::
|
91
|
+
rescue Net::HTTPClientException => e
|
92
92
|
if e.response.code == "404"
|
93
93
|
ui.warn <<~EOF
|
94
94
|
User #{username} is not in the #{admin_group_string} group for organization #{org_name}.
|
data/lib/chef/knife/version.rb
CHANGED
@@ -992,7 +992,7 @@ describe "knife delete", :workstation do
|
|
992
992
|
end
|
993
993
|
|
994
994
|
it "knife delete /policies/x-1.2.3.json succeeds" do
|
995
|
-
knife("raw /policies/x/revisions/1.2.3").should_succeed "{\n \"name\": \"x\",\n \"revision_id\": \"1.2.3\",\n \"run_list\": [\n\n ],\n \"cookbook_locks\": {\n\n }\n}\n"
|
995
|
+
knife("raw /policies/x/revisions/1.2.3").should_succeed "{\n \"policy_group_list\": [\n \"x\"\n ],\n \"name\": \"x\",\n \"revision_id\": \"1.2.3\",\n \"run_list\": [\n\n ],\n \"cookbook_locks\": {\n\n }\n}\n"
|
996
996
|
knife("delete /policies/x-1.2.3.json").should_succeed "Deleted /policies/x-1.2.3.json\n"
|
997
997
|
knife("raw /policies/x/revisions/1.2.3").should_fail(/404/)
|
998
998
|
end
|
@@ -1276,8 +1276,8 @@ describe "knife download", :workstation do
|
|
1276
1276
|
file "members.json", [ "bar" ]
|
1277
1277
|
file "nodes/x.json", { "normal" => { "tags" => [] } }
|
1278
1278
|
file "org.json", { "full_name" => "Something" }
|
1279
|
-
file "policies/x-1.0.0.json", {}
|
1280
|
-
file "policies/blah-1.0.0.json", {}
|
1279
|
+
file "policies/x-1.0.0.json", { "policy_group_list" => [ "x" ] }
|
1280
|
+
file "policies/blah-1.0.0.json", { "policy_group_list" => [ "x" ] }
|
1281
1281
|
file "policy_groups/x.json", { "policies" => { "x" => { "revision_id" => "1.0.0" }, "blah" => { "revision_id" => "1.0.0" } } }
|
1282
1282
|
file "roles/x.json", {}
|
1283
1283
|
end
|
@@ -1383,8 +1383,8 @@ describe "knife upload", :workstation do
|
|
1383
1383
|
file "members.json", [ "bar" ]
|
1384
1384
|
file "org.json", { "full_name" => "wootles" }
|
1385
1385
|
file "nodes/x.json", { "normal" => { "tags" => [] } }
|
1386
|
-
file "policies/x-1.0.0.json", {}
|
1387
|
-
file "policies/blah-1.0.0.json", {}
|
1386
|
+
file "policies/x-1.0.0.json", { "policy_group_list" => [ "x" ] }
|
1387
|
+
file "policies/blah-1.0.0.json", { "policy_group_list" => [ "x" ] }
|
1388
1388
|
file "policy_groups/x.json", { "policies" => { "x" => { "revision_id" => "1.0.0" }, "blah" => { "revision_id" => "1.0.0" } } }
|
1389
1389
|
file "roles/x.json", {}
|
1390
1390
|
end
|
@@ -1484,12 +1484,11 @@ describe "knife upload", :workstation do
|
|
1484
1484
|
environment "x", { "description" => "foo" }
|
1485
1485
|
group "x", { "groups" => [ "admin" ] }
|
1486
1486
|
node "x", { "run_list" => [ "blah" ] }
|
1487
|
-
policy "x", "1.0.0", {}
|
1488
|
-
policy "
|
1489
|
-
policy "y", "1.0.0", {}
|
1487
|
+
policy "x", "1.0.0", { "policy_group_list" => [ "x" ] }
|
1488
|
+
policy "y", "1.0.0", { "policy_group_list" => [ "x" ] }
|
1490
1489
|
policy_group "x", {
|
1491
1490
|
"policies" => {
|
1492
|
-
"x" => { "revision_id" => "1.0.
|
1491
|
+
"x" => { "revision_id" => "1.0.0" },
|
1493
1492
|
"y" => { "revision_id" => "1.0.0" },
|
1494
1493
|
},
|
1495
1494
|
}
|
@@ -817,7 +817,7 @@ describe Chef::Knife::Bootstrap do
|
|
817
817
|
# Set everything to easily identifiable and obviously fake values
|
818
818
|
# to verify that Chef::Config is being sourced instead of knife.config
|
819
819
|
knife.config = {}
|
820
|
-
Chef::Config[:knife][:max_wait] = 9999
|
820
|
+
Chef::Config[:knife][:max_wait] = 9999.0
|
821
821
|
Chef::Config[:knife][:winrm_user] = "winbob"
|
822
822
|
Chef::Config[:knife][:winrm_port] = 9999
|
823
823
|
Chef::Config[:knife][:ca_trust_file] = "trust.me"
|
@@ -836,7 +836,7 @@ describe Chef::Knife::Bootstrap do
|
|
836
836
|
{
|
837
837
|
logger: Chef::Log, # not configurable
|
838
838
|
ca_trust_path: "trust.me",
|
839
|
-
max_wait_until_ready: 9999,
|
839
|
+
max_wait_until_ready: 9999, # converted to int
|
840
840
|
operation_timeout: 9999,
|
841
841
|
ssl_peer_fingerprint: "ABCDEF",
|
842
842
|
winrm_transport: "kerberos",
|
@@ -899,7 +899,7 @@ describe Chef::Knife::Bootstrap do
|
|
899
899
|
# pull in the Chef::Config value
|
900
900
|
Chef::Config[:knife][:winrm_auth_method] = "negotiate"
|
901
901
|
knife.config[:connection_password] = "blue"
|
902
|
-
knife.config[:max_wait] = 1000
|
902
|
+
knife.config[:max_wait] = 1000.0
|
903
903
|
knife.config[:connection_user] = "clippy"
|
904
904
|
knife.config[:connection_port] = 1000
|
905
905
|
knife.config[:winrm_port] = 1001 # We should not see this value get used
|
@@ -918,7 +918,7 @@ describe Chef::Knife::Bootstrap do
|
|
918
918
|
{
|
919
919
|
logger: Chef::Log, # not configurable
|
920
920
|
ca_trust_path: "trust.the.internet",
|
921
|
-
max_wait_until_ready: 1000,
|
921
|
+
max_wait_until_ready: 1000, # converted to int
|
922
922
|
operation_timeout: 1000,
|
923
923
|
ssl_peer_fingerprint: "FEDCBA",
|
924
924
|
winrm_transport: "kerberos",
|
@@ -971,7 +971,7 @@ describe Chef::Knife::Bootstrap do
|
|
971
971
|
# Set everything to easily identifiable and obviously fake values
|
972
972
|
# to verify that Chef::Config is being sourced instead of knife.config
|
973
973
|
knife.config = {}
|
974
|
-
Chef::Config[:knife][:max_wait] = 9999
|
974
|
+
Chef::Config[:knife][:max_wait] = 9999.0
|
975
975
|
Chef::Config[:knife][:session_timeout] = 9999
|
976
976
|
Chef::Config[:knife][:ssh_user] = "sshbob"
|
977
977
|
Chef::Config[:knife][:ssh_port] = 9999
|
@@ -986,7 +986,7 @@ describe Chef::Knife::Bootstrap do
|
|
986
986
|
let(:expected_result) do
|
987
987
|
{
|
988
988
|
logger: Chef::Log, # not configurable
|
989
|
-
max_wait_until_ready: 9999
|
989
|
+
max_wait_until_ready: 9999, # converted to int
|
990
990
|
connection_timeout: 9999,
|
991
991
|
user: "sshbob",
|
992
992
|
bastion_host: "mygateway.local",
|
@@ -1032,7 +1032,7 @@ describe Chef::Knife::Bootstrap do
|
|
1032
1032
|
knife.config[:connection_port] = 12
|
1033
1033
|
knife.config[:ssh_port] = "13" # canary to indirectly verify we're not looking for the wrong CLI flag
|
1034
1034
|
knife.config[:connection_password] = "feta cheese"
|
1035
|
-
knife.config[:max_wait] = 150
|
1035
|
+
knife.config[:max_wait] = 150.0
|
1036
1036
|
knife.config[:session_timeout] = 120
|
1037
1037
|
knife.config[:use_sudo] = true
|
1038
1038
|
knife.config[:use_sudo_pasword] = true
|
@@ -1042,7 +1042,7 @@ describe Chef::Knife::Bootstrap do
|
|
1042
1042
|
let(:expected_result) do
|
1043
1043
|
{
|
1044
1044
|
logger: Chef::Log, # not configurable
|
1045
|
-
max_wait_until_ready: 150
|
1045
|
+
max_wait_until_ready: 150, # cli (converted to int)
|
1046
1046
|
connection_timeout: 120, # cli
|
1047
1047
|
user: "sshalice", # cli
|
1048
1048
|
password: "feta cheese", # cli
|
@@ -1068,7 +1068,7 @@ describe Chef::Knife::Bootstrap do
|
|
1068
1068
|
context "and all CLI options have been given" do
|
1069
1069
|
before do
|
1070
1070
|
knife.config = {}
|
1071
|
-
knife.config[:max_wait] = 150
|
1071
|
+
knife.config[:max_wait] = 150.0
|
1072
1072
|
knife.config[:session_timeout] = 120
|
1073
1073
|
knife.config[:connection_user] = "sshroot"
|
1074
1074
|
knife.config[:connection_port] = 1000
|
@@ -1093,7 +1093,7 @@ describe Chef::Knife::Bootstrap do
|
|
1093
1093
|
let(:expected_result) do
|
1094
1094
|
{
|
1095
1095
|
logger: Chef::Log, # not configurable
|
1096
|
-
max_wait_until_ready: 150,
|
1096
|
+
max_wait_until_ready: 150, # converted to int
|
1097
1097
|
connection_timeout: 120,
|
1098
1098
|
user: "sshroot",
|
1099
1099
|
password: "blah",
|
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.9.9
|
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-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|
@@ -228,20 +228,6 @@ dependencies:
|
|
228
228
|
- - ">="
|
229
229
|
- !ruby/object:Gem::Version
|
230
230
|
version: 1.2.1
|
231
|
-
- !ruby/object:Gem::Dependency
|
232
|
-
name: ed25519
|
233
|
-
requirement: !ruby/object:Gem::Requirement
|
234
|
-
requirements:
|
235
|
-
- - "~>"
|
236
|
-
- !ruby/object:Gem::Version
|
237
|
-
version: '1.2'
|
238
|
-
type: :runtime
|
239
|
-
prerelease: false
|
240
|
-
version_requirements: !ruby/object:Gem::Requirement
|
241
|
-
requirements:
|
242
|
-
- - "~>"
|
243
|
-
- !ruby/object:Gem::Version
|
244
|
-
version: '1.2'
|
245
231
|
- !ruby/object:Gem::Dependency
|
246
232
|
name: bcrypt_pbkdf
|
247
233
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1150,7 +1136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1150
1136
|
- !ruby/object:Gem::Version
|
1151
1137
|
version: '0'
|
1152
1138
|
requirements: []
|
1153
|
-
rubygems_version: 3.2.
|
1139
|
+
rubygems_version: 3.2.32
|
1154
1140
|
signing_key:
|
1155
1141
|
specification_version: 4
|
1156
1142
|
summary: The knife CLI for Chef Infra.
|