summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Asuncion <jose.asuncion@gmail.com>2017-08-16 18:25:05 -0700
committerJose Asuncion <jose.asuncion@gmail.com>2017-08-16 18:25:05 -0700
commit61916b652b80f3e6982bac0c925b86b32b7571f6 (patch)
tree4fad729321bd73a3ada07ec894bd916eb5e0fa42
parent0eb90ddd97fa97e3a225453baaccf32194aef06d (diff)
downloadchef-61916b652b80f3e6982bac0c925b86b32b7571f6.tar.gz
Revert "raise error if chef_server_url is not valid"
This reverts commit 02a46911341c1d5ef10309d27963031d598dbe2c.
-rw-r--r--lib/chef/server_api.rb4
-rw-r--r--spec/unit/server_api_spec.rb12
2 files changed, 0 insertions, 16 deletions
diff --git a/lib/chef/server_api.rb b/lib/chef/server_api.rb
index d4644e8fc7..2bdc5d9fe8 100644
--- a/lib/chef/server_api.rb
+++ b/lib/chef/server_api.rb
@@ -25,7 +25,6 @@ require "chef/http/json_output"
require "chef/http/remote_request_id"
require "chef/http/validate_content_length"
require "chef/http/api_versions"
-require "chef/exceptions"
class Chef
class ServerAPI < Chef::HTTP
@@ -36,9 +35,6 @@ class Chef
options[:signing_key_filename] = nil if chef_zero_uri?(url)
options[:inflate_json_class] = false
super(url, options)
-
- chef_server_attrs = get("/").keys.sort
- raise Chef::Exceptions::NotAChefServerException if %w[ guid full_name name ].sort != chef_server_attrs
end
use Chef::HTTP::JSONInput
diff --git a/spec/unit/server_api_spec.rb b/spec/unit/server_api_spec.rb
index 7326ec3894..05d2a28ed4 100644
--- a/spec/unit/server_api_spec.rb
+++ b/spec/unit/server_api_spec.rb
@@ -31,11 +31,6 @@ Y6S6MeZ69Rp89ma4ttMZ+kwi1+XyHqC/dlcVRW42Zl5Dc7BALRlJjQ==
describe Chef::ServerAPI do
let(:url) { "http://chef.example.com:4000" }
let(:key_path) { "/tmp/foo" }
- let(:org_data) { { "name" => "some_name", "full_name" => "some_full_name", "guid" => "abc1223" } }
-
- before(:each) do
- allow_any_instance_of(described_class).to receive(:get).with("/").and_return(org_data)
- end
describe "#initialize" do
it "uses the configured key file" do
@@ -51,12 +46,5 @@ describe Chef::ServerAPI do
expect(api.options[:signing_key_filename]).to be_nil
expect(api.options[:raw_key]).to eql(SIGNING_KEY_DOT_PEM)
end
-
- context "when url is not a chef server" do
- let(:org_data) { Hash.new }
- it "throws exception" do
- expect { described_class.new(url, raw_key: SIGNING_KEY_DOT_PEM) }.to raise_exception(Chef::Exceptions::NotAChefServerException)
- end
- end
end
end