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 +4 -4
- data/lib/chef-cli/policyfile/comparison_base.rb +1 -0
- data/lib/chef-cli/policyfile/remote_lock_fetcher.rb +1 -1
- data/lib/chef-cli/service_exception_inspectors/http.rb +0 -26
- data/lib/chef-cli/version.rb +1 -1
- data/spec/unit/service_exception_inspectors/http_spec.rb +3 -17
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 027ecd97cab2e569bf86814f9e3788746e9b55a3f31349269b4429e757b96ef9
         | 
| 4 | 
            +
              data.tar.gz: 354eb9e12001d0a46cab5b3989e352dec5802885f99dd0a69a9d7a90e3613cab
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 129c857eb35d45bfaf5b1ebec95bc80e691571b327d875d7da4ac7e26c7192ee6f5ac2ed79ffbd22cba920284b4c07609f50f0065b242ad93e1b5ad75a902f44
         | 
| 7 | 
            +
              data.tar.gz: 7b8813adc11b52f0b5e6280444db3e025e9aa57494b2d17af59cb93ebf7a464e5a9670ecc15b99f5e143383ef073f35d04f56e2fe56b02a2bbc36b5da3ce6ad4
         | 
| @@ -18,7 +18,7 @@ | |
| 18 18 | 
             
            require_relative "../policyfile_lock"
         | 
| 19 19 | 
             
            require_relative "lock_fetcher_mixin"
         | 
| 20 20 | 
             
            require_relative "../exceptions"
         | 
| 21 | 
            -
            require " | 
| 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
         | 
    
        data/lib/chef-cli/version.rb
    CHANGED
    
    
| @@ -16,8 +16,7 @@ | |
| 16 16 | 
             
            #
         | 
| 17 17 |  | 
| 18 18 | 
             
            require "spec_helper"
         | 
| 19 | 
            -
            require "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) | 
| 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  | 
| 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. | 
| 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:  | 
| 11 | 
            +
            date: 2021-01-07 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: mixlib-cli
         |