cheffish 15.0.3 → 16.0.2

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: 547830e01071a34cc583bbf5217ae5f55270c014c393e9a69301023a88717279
4
- data.tar.gz: a29005438abb411a4b59bc7b1cf1782e36219e2bd951ec49c64273f9a7de6144
3
+ metadata.gz: 6c3c4f0101eecf3d58f4c8d0e67f048427e62856c021540eb51d84f1569388e2
4
+ data.tar.gz: c2ab2b550d930ff25636fd8766b75aa11fdd27b9b8da7657ed75ecfc9f0de147
5
5
  SHA512:
6
- metadata.gz: 6db5d7117bb249b37d894d3b3e776f7d3b5e8c87cb2895e156fbe4393031dbfdfdcff8a9133b4bb7e578f85440905a5acbd30426e7a8d81171ac3fd44f583936
7
- data.tar.gz: 2216df827dc0635fdf0e3a340a80dbf267c8c51f58d7bde7c2a7deb28f0b3eeb24975bc88e3c44809c12189c05751a8624285d90a7472ace2bbb6b69dd99542d
6
+ metadata.gz: a5c5fba98d56455fdc236dbc535edfb9e7def8f77d4640f2c7b01fbfecf320b033f9d2fc60b4bea7144866e6dc1b3743c8bb7b99a9fbd31c715eb74a6a42fa2b
7
+ data.tar.gz: 11461870b40ed6af669b1f688dd119b49cc0ff6bee8e801c0c047facfb598427c691f846530e9dae9b8df282014a66c32c6475ada7ff3efafe7e5a62a05751b0
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  s.version = Cheffish::VERSION
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.license = "Apache-2.0"
9
- s.summary = "A set of Chef resources for configuring Chef."
9
+ s.summary = "A set of Chef resources for configuring Chef Infra."
10
10
  s.description = s.summary
11
11
  s.author = "Chef Software Inc."
12
12
  s.email = "oss@chef.io"
@@ -75,7 +75,7 @@ class Chef
75
75
  end
76
76
  end
77
77
 
78
- action_class.class_eval do
78
+ action_class do
79
79
  # Update the ACL if necessary.
80
80
  def create_acl(path)
81
81
  changed = false
@@ -147,7 +147,7 @@ class Chef
147
147
  unless @current_acls.key?(acl_path)
148
148
  @current_acls[acl_path] = begin
149
149
  rest.get(rest_url(acl_path))
150
- rescue Net::HTTPServerException => e
150
+ rescue Net::HTTPClientException => e
151
151
  unless e.response.code == "404" && new_resource.path.split("/").any? { |p| p == "*" }
152
152
  raise
153
153
  end
@@ -471,7 +471,7 @@ class Chef
471
471
  def rest_list(path)
472
472
  # All our rest lists are hashes where the keys are the names
473
473
  [ rest.get(rest_url(path)).keys, nil ]
474
- rescue Net::HTTPServerException => e
474
+ rescue Net::HTTPClientException => e
475
475
  if e.response.code == "405" || e.response.code == "404"
476
476
  parts = path.split("/").select { |p| p != "" }.to_a
477
477
 
@@ -38,7 +38,7 @@ class Chef
38
38
  delete_actor
39
39
  end
40
40
 
41
- action_class.class_eval do
41
+ action_class do
42
42
  def actor_type
43
43
  "client"
44
44
  end
@@ -25,10 +25,10 @@ class Chef
25
25
  end
26
26
  end
27
27
 
28
- action_class.class_eval do
28
+ action_class do
29
29
  def load_current_resource
30
30
  @current_exists = rest.get("containers/#{new_resource.chef_container_name}")
31
- rescue Net::HTTPServerException => e
31
+ rescue Net::HTTPClientException => e
32
32
  if e.response.code == "404"
33
33
  @current_exists = false
34
34
  else
@@ -27,7 +27,7 @@ class Chef
27
27
  action_class.class_eval do
28
28
  def load_current_resource
29
29
  @current_resource = json_to_resource(rest.get("data/#{new_resource.data_bag_name}"))
30
- rescue Net::HTTPServerException => e
30
+ rescue Net::HTTPClientException => e
31
31
  if e.response.code == "404"
32
32
  @current_resource = not_found_resource
33
33
  else
@@ -103,7 +103,7 @@ class Chef
103
103
  resource = Chef::Resource::ChefDataBagItem.new(new_resource.name, run_context)
104
104
  resource.raw_data json
105
105
  @current_resource = resource
106
- rescue Net::HTTPServerException => e
106
+ rescue Net::HTTPClientException => e
107
107
  if e.response.code == "404"
108
108
  @current_resource = not_found_resource
109
109
  else
@@ -84,7 +84,7 @@ class Chef
84
84
  action_class.class_eval do
85
85
  def load_current_resource
86
86
  @current_resource = json_to_resource(rest.get("environments/#{new_resource.environment_name}"))
87
- rescue Net::HTTPServerException => e
87
+ rescue Net::HTTPClientException => e
88
88
  if e.response.code == "404"
89
89
  @current_resource = not_found_resource
90
90
  else
@@ -45,7 +45,7 @@ class Chef
45
45
  action_class.class_eval do
46
46
  def load_current_resource
47
47
  @current_resource = json_to_resource(rest.get("groups/#{new_resource.group_name}"))
48
- rescue Net::HTTPServerException => e
48
+ rescue Net::HTTPClientException => e
49
49
  if e.response.code == "404"
50
50
  @current_resource = not_found_resource
51
51
  else
@@ -39,7 +39,7 @@ class Chef
39
39
  action_class.class_eval do
40
40
  def load_current_resource
41
41
  @current_resource = json_to_resource(rest.get("nodes/#{new_resource.name}"))
42
- rescue Net::HTTPServerException => e
42
+ rescue Net::HTTPClientException => e
43
43
  if e.response.code == "404"
44
44
  @current_resource = not_found_resource
45
45
  else
@@ -130,7 +130,7 @@ class Chef
130
130
  action_class.class_eval do
131
131
  def load_current_resource
132
132
  @current_resource = json_to_resource(rest.get("#{rest.root_url}/organizations/#{new_resource.organization_name}"))
133
- rescue Net::HTTPServerException => e
133
+ rescue Net::HTTPClientException => e
134
134
  if e.response.code == "404"
135
135
  @current_resource = not_found_resource
136
136
  else
@@ -123,7 +123,7 @@ class Chef
123
123
  action_class.class_eval do
124
124
  def load_current_resource
125
125
  @current_resource = json_to_resource(rest.get("roles/#{new_resource.role_name}"))
126
- rescue Net::HTTPServerException => e
126
+ rescue Net::HTTPClientException => e
127
127
  if e.response.code == "404"
128
128
  @current_resource = not_found_resource
129
129
  else
@@ -119,7 +119,7 @@ module Cheffish
119
119
  begin
120
120
  json = rest.get("#{actor_path}/#{new_resource.name}")
121
121
  @current_resource = json_to_resource(json)
122
- rescue Net::HTTPServerException => e
122
+ rescue Net::HTTPClientException => e
123
123
  if e.response.code == "404"
124
124
  @current_resource = not_found_resource
125
125
  else
@@ -1,3 +1,3 @@
1
1
  module Cheffish
2
- VERSION = "15.0.3".freeze
2
+ VERSION = "16.0.2".freeze
3
3
  end
@@ -191,7 +191,7 @@ if Gem::Version.new(ChefZero::VERSION) >= Gem::Version.new("3.1")
191
191
  it 'Converging chef_acl "nodes/y" throws a 404' do
192
192
  expect_converge do
193
193
  chef_acl "nodes/y"
194
- end.to raise_error(Net::HTTPServerException)
194
+ end.to raise_error(Net::HTTPClientException)
195
195
  end
196
196
  end
197
197
 
@@ -37,7 +37,7 @@ describe Chef::Resource::ChefGroup do
37
37
  action :delete
38
38
  end
39
39
  end.to not_have_updated("chef_group[x]", :delete).and not_have_updated("chef_group[x]", :create)
40
- expect { get("groups/x") }.to raise_error(Net::HTTPServerException)
40
+ expect { get("groups/x") }.to raise_error(Net::HTTPClientException)
41
41
  end
42
42
 
43
43
  it 'Converging chef_group "x" creates the group with the given members' do
@@ -101,7 +101,7 @@ describe Chef::Resource::ChefGroup do
101
101
  action :delete
102
102
  end
103
103
  end.to have_updated("chef_group[x]", :delete)
104
- expect { get("groups/x") }.to raise_error(Net::HTTPServerException)
104
+ expect { get("groups/x") }.to raise_error(Net::HTTPClientException)
105
105
  end
106
106
 
107
107
  it 'Converging chef_group "x" with existing users changes nothing' do
@@ -40,7 +40,7 @@ describe Chef::Resource::ChefNode do
40
40
  with_chef_server "http://127.0.0.1:8899"
41
41
  chef_node "blah"
42
42
  end.to have_updated "chef_node[blah]", :create
43
- expect { get("nodes/blah") }.to raise_error(Net::HTTPServerException)
43
+ expect { get("nodes/blah") }.to raise_error(Net::HTTPClientException)
44
44
  expect(get("http://127.0.0.1:8899/nodes/blah")["name"]).to eq("blah")
45
45
  end
46
46
  end
@@ -53,7 +53,7 @@ describe Chef::Resource::ChefNode do
53
53
  chef_server({ chef_server_url: "http://127.0.0.1:8899" })
54
54
  end
55
55
  end.to have_updated "chef_node[blah]", :create
56
- expect { get("nodes/blah") }.to raise_error(Net::HTTPServerException)
56
+ expect { get("nodes/blah") }.to raise_error(Net::HTTPClientException)
57
57
  expect(get("http://127.0.0.1:8899/nodes/blah")["name"]).to eq("blah")
58
58
  end
59
59
  end
@@ -40,7 +40,7 @@ describe Chef::Resource::ChefRole do
40
40
  with_chef_server "http://127.0.0.1:8899"
41
41
  chef_role "blah"
42
42
  end.to have_updated "chef_role[blah]", :create
43
- expect { get("roles/blah") }.to raise_error(Net::HTTPServerException)
43
+ expect { get("roles/blah") }.to raise_error(Net::HTTPClientException)
44
44
  expect(get("http://127.0.0.1:8899/roles/blah")["name"]).to eq("blah")
45
45
  end
46
46
  end
@@ -53,7 +53,7 @@ describe Chef::Resource::ChefRole do
53
53
  chef_server({ chef_server_url: "http://127.0.0.1:8899" })
54
54
  end
55
55
  end.to have_updated "chef_role[blah]", :create
56
- expect { get("roles/blah") }.to raise_error(Net::HTTPServerException)
56
+ expect { get("roles/blah") }.to raise_error(Net::HTTPClientException)
57
57
  expect(get("http://127.0.0.1:8899/roles/blah")["name"]).to eq("blah")
58
58
  end
59
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheffish
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.0.3
4
+ version: 16.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-13 00:00:00.000000000 Z
11
+ date: 2020-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-zero
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: A set of Chef resources for configuring Chef.
41
+ description: A set of Chef resources for configuring Chef Infra.
42
42
  email: oss@chef.io
43
43
  executables: []
44
44
  extensions: []
@@ -130,5 +130,5 @@ requirements: []
130
130
  rubygems_version: 3.0.3
131
131
  signing_key:
132
132
  specification_version: 4
133
- summary: A set of Chef resources for configuring Chef.
133
+ summary: A set of Chef resources for configuring Chef Infra.
134
134
  test_files: []