chef-cli 3.0.33 → 3.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e62dfc227a16206b504aa0a8838d2e1960e38573e0d1f2646fc4e14b1e174df
4
- data.tar.gz: cfca788e2ae2a92d7014d62c4fc65c20d20cbe9b57a9c8bad24e342f70262167
3
+ metadata.gz: 027ecd97cab2e569bf86814f9e3788746e9b55a3f31349269b4429e757b96ef9
4
+ data.tar.gz: 354eb9e12001d0a46cab5b3989e352dec5802885f99dd0a69a9d7a90e3613cab
5
5
  SHA512:
6
- metadata.gz: a4adff5f07ea9bf2fee6933c5b2f91eeebd2ceab36ba27c72f3ddf38555ce43940e31f7975c5cf3df1a0869f6d548869af33dd1fc70e30e1223b3c70634a5aad
7
- data.tar.gz: a3c7f7187f9ee410517c4a81bd4160ef0f55cb3101b7197ef3c0d902e01863356ce5f8e35c52c15213b53e3680c17996d4a1eb13bb1ce4d9a30335e32858e72a
6
+ metadata.gz: 129c857eb35d45bfaf5b1ebec95bc80e691571b327d875d7da4ac7e26c7192ee6f5ac2ed79ffbd22cba920284b4c07609f50f0065b242ad93e1b5ad75a902f44
7
+ data.tar.gz: 7b8813adc11b52f0b5e6280444db3e025e9aa57494b2d17af59cb93ebf7a464e5a9670ecc15b99f5e143383ef073f35d04f56e2fe56b02a2bbc36b5da3ce6ad4
@@ -21,6 +21,7 @@ end
21
21
 
22
22
  autoload :FFI_Yajl, "ffi_yajl"
23
23
  require_relative "../service_exceptions"
24
+ require "net/protocol" unless defined?(Net::ProtocolError)
24
25
 
25
26
  module ChefCLI
26
27
  module Policyfile
@@ -18,7 +18,7 @@
18
18
  require_relative "../policyfile_lock"
19
19
  require_relative "lock_fetcher_mixin"
20
20
  require_relative "../exceptions"
21
- require "chef/http"
21
+ require "net/protocol" unless defined?(Net::ProtocolError)
22
22
  require "tempfile" unless defined?(Tempfile)
23
23
 
24
24
  module ChefCLI
@@ -33,17 +33,11 @@ module ChefCLI
33
33
 
34
34
  def extended_error_info
35
35
  <<~END
36
- --- REQUEST DATA ----
37
- #{http_method} #{uri}
38
- #{request_headers}
39
- #{req_body}
40
-
41
36
  --- RESPONSE DATA ---
42
37
  #{code} #{response_message}
43
38
  #{response_headers}
44
39
 
45
40
  #{response_body}
46
-
47
41
  END
48
42
  end
49
43
 
@@ -90,30 +84,10 @@ module ChefCLI
90
84
  headers_s
91
85
  end
92
86
 
93
- def request
94
- exception.chef_rest_request
95
- end
96
-
97
87
  def uri
98
88
  request.uri.to_s + request.path.to_s
99
89
  end
100
90
 
101
- def http_method
102
- request.method
103
- end
104
-
105
- def request_headers
106
- headers_s = ""
107
- request.each_header do |key, value|
108
- headers_s << key << ": " << value << "\n"
109
- end
110
- headers_s
111
- end
112
-
113
- def req_body
114
- request.body
115
- end
116
-
117
91
  end
118
92
  end
119
93
  end
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module ChefCLI
19
- VERSION = "3.0.33".freeze
19
+ VERSION = "3.0.35".freeze
20
20
  end
@@ -16,8 +16,7 @@
16
16
  #
17
17
 
18
18
  require "spec_helper"
19
- require "net/http" unless defined?(Net::HTTP)
20
- require "chef/monkey_patches/net_http"
19
+ require "net/http"
21
20
  require "chef-cli/service_exception_inspectors/http"
22
21
 
23
22
  describe ChefCLI::ServiceExceptionInspectors::HTTP do
@@ -64,7 +63,7 @@ describe ChefCLI::ServiceExceptionInspectors::HTTP do
64
63
  end
65
64
 
66
65
  let(:exception) do
67
- Net::HTTPClientException.new(message, response).tap { |e| e.chef_rest_request = request }
66
+ Net::HTTPClientException.new(message, response)
68
67
  end
69
68
 
70
69
  subject(:inspector) { described_class.new(exception) }
@@ -103,23 +102,10 @@ describe ChefCLI::ServiceExceptionInspectors::HTTP do
103
102
 
104
103
  end
105
104
 
106
- describe "showing the request and response in extended error info" do
105
+ describe "showing the response in extended error info" do
107
106
 
108
107
  let(:response_body) { "this is the response" }
109
108
 
110
- it "shows the request in a format similar to HTTP messages" do
111
- expected_request_string = <<~E
112
- --- REQUEST DATA ----
113
- POST /organizations/chef-oss-dev/cookbooks
114
- content-type: application/json
115
- accept: application/json
116
-
117
- this is the request
118
-
119
- E
120
- expect(inspector.extended_error_info).to include(expected_request_string)
121
- end
122
-
123
109
  it "shows the response in a format similar to HTTP messages" do
124
110
  expected_response_string = <<~E
125
111
  --- RESPONSE DATA ---
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.33
4
+ version: 3.0.35
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-10-21 00:00:00.000000000 Z
11
+ date: 2021-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-cli