summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-05-10 12:22:23 -0700
committerdanielsdeleo <dan@opscode.com>2013-05-10 12:23:24 -0700
commitf6b8642d396e18b762721e7334f399ca90108461 (patch)
tree9822c52804dade71388072a070f54549c524c2c4
parentcba4cccb2d12283f8e39a23bc92c8e925f3ec8ee (diff)
downloadchef-f6b8642d396e18b762721e7334f399ca90108461.tar.gz
[CHEF-4176] remove unneeded aliases for chef_server_url
-rw-r--r--lib/chef/config.rb8
-rw-r--r--lib/chef/run_list/run_list_expansion.rb2
-rw-r--r--lib/chef/search/query.rb4
-rw-r--r--spec/unit/config_spec.rb44
4 files changed, 25 insertions, 33 deletions
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index 04d39469f3..55a62aacd5 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -74,11 +74,7 @@ class Chef
config_attr_writer :chef_server_url do |url|
url = url.strip
configure do |c|
- [ :search_url,
- :chef_server_url,
- :role_url ].each do |u|
- c[u] = url
- end
+ c[:chef_server_url] = url
end
url
end
@@ -188,8 +184,6 @@ class Chef
pid_file nil
chef_server_url "http://localhost:4000"
- role_url "http://localhost:4000"
- search_url "http://localhost:4000"
rest_timeout 300
solo false
diff --git a/lib/chef/run_list/run_list_expansion.rb b/lib/chef/run_list/run_list_expansion.rb
index 7b8108a2d4..73665f39e7 100644
--- a/lib/chef/run_list/run_list_expansion.rb
+++ b/lib/chef/run_list/run_list_expansion.rb
@@ -173,7 +173,7 @@ class Chef
class RunListExpansionFromAPI < RunListExpansion
def rest
- @rest ||= (source || Chef::REST.new(Chef::Config[:role_url]))
+ @rest ||= (source || Chef::REST.new(Chef::Config[:chef_server_url]))
end
def fetch_role(name, included_by)
diff --git a/lib/chef/search/query.rb b/lib/chef/search/query.rb
index d147bc0005..4869ec1484 100644
--- a/lib/chef/search/query.rb
+++ b/lib/chef/search/query.rb
@@ -31,7 +31,7 @@ class Chef
attr_accessor :rest
def initialize(url=nil)
- @rest = Chef::REST.new(url ||Chef::Config[:search_url])
+ @rest = Chef::REST.new(url ||Chef::Config[:chef_server_url])
end
# Search Solr for objects of a given type, for a given query. If you give
@@ -53,7 +53,7 @@ class Chef
end
def list_indexes
- response = @rest.get_rest("search")
+ @rest.get_rest("search")
end
private
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index 270bc591e0..f35b47d50a 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -24,30 +24,36 @@ describe Chef::Config do
@original_env = { 'HOME' => ENV['HOME'], 'SYSTEMDRIVE' => ENV['SYSTEMDRIVE'], 'HOMEPATH' => ENV['HOMEPATH'], 'USERPROFILE' => ENV['USERPROFILE'] }
end
- shared_examples_for "server URL" do
- it "should set the search url" do
- Chef::Config.search_url.should == "https://junglist.gen.nz"
+ describe "config attribute writer: chef_server_url" do
+ before do
+ Chef::Config.chef_server_url = "https://junglist.gen.nz"
end
- it "should set the role url" do
- Chef::Config.role_url.should == "https://junglist.gen.nz"
+ it "sets the server url" do
+ Chef::Config.chef_server_url.should == "https://junglist.gen.nz"
end
- end
- describe "config attribute writer: chef_server_url" do
- before do
- Chef::Config.chef_server_url = "https://junglist.gen.nz"
+ context "when the url has a leading space" do
+ before do
+ Chef::Config.chef_server_url = " https://junglist.gen.nz"
+ end
+
+ it "strips the space from the url when setting" do
+ Chef::Config.chef_server_url.should == "https://junglist.gen.nz"
+ end
+
end
- it_behaves_like "server URL"
- end
+ context "when the url is a frozen string" do
+ before do
+ Chef::Config.chef_server_url = " https://junglist.gen.nz".freeze
+ end
- context "when the url has a leading space" do
- before do
- Chef::Config.chef_server_url = " https://junglist.gen.nz"
+ it "strips the space from the url when setting without raising an error" do
+ Chef::Config.chef_server_url.should == "https://junglist.gen.nz"
+ end
end
- it_behaves_like "server URL"
end
describe "when configuring formatters" do
@@ -94,14 +100,6 @@ describe Chef::Config do
end
- context "when the url is a frozen string" do
- before do
- Chef::Config.chef_server_url = " https://junglist.gen.nz".freeze
- end
-
- it_behaves_like "server URL"
- end
-
describe "class method: manage_secret_key" do
before do
Chef::FileCache.stub!(:load).and_return(true)