summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlamont-granquist <lamont@scriptkiddie.org>2014-08-20 15:33:23 -0700
committerlamont-granquist <lamont@scriptkiddie.org>2014-08-20 15:33:23 -0700
commitf5f781bcaa966a92d8944584e6195e4824c4e97c (patch)
tree233fbab85e66f60dffcc9add5bf1b86e22f2b86e
parent60620ef85240cacf4236b4dc6b5ac1ec15d675f1 (diff)
parentec7803b3927d56c9a111def3355244048aee86b7 (diff)
downloadchef-f5f781bcaa966a92d8944584e6195e4824c4e97c.tar.gz
Merge pull request #1871 from opscode/lcg/supermarket-urls
Lcg/supermarket urls
-rw-r--r--CHANGELOG.md2
-rw-r--r--lib/chef/knife/cookbook_site_download.rb2
-rw-r--r--lib/chef/knife/cookbook_site_list.rb2
-rw-r--r--lib/chef/knife/cookbook_site_search.rb2
-rw-r--r--lib/chef/knife/cookbook_site_share.rb2
-rw-r--r--lib/chef/knife/cookbook_site_show.rb6
-rw-r--r--lib/chef/knife/cookbook_site_unshare.rb2
-rw-r--r--spec/unit/knife/cookbook_site_download_spec.rb2
-rw-r--r--spec/unit/knife/cookbook_site_share_spec.rb6
9 files changed, 14 insertions, 12 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 00a59bb8c2..365787eb26 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased: 12.0.0
+* knife cookbook site download/list/search/share/show/unshare now uses
+ supermerket.getchef.com urls
* chef/json_compat now throws its own exceptions not JSON gem exceptions
* Modify action for env raises Chef::Exceptions::Env exception on Windows (Chef Issues 1754)
* Fix a bug in the experimental Policyfile mode that caused errors when
diff --git a/lib/chef/knife/cookbook_site_download.rb b/lib/chef/knife/cookbook_site_download.rb
index 645b1728e6..de6e21d0d2 100644
--- a/lib/chef/knife/cookbook_site_download.rb
+++ b/lib/chef/knife/cookbook_site_download.rb
@@ -58,7 +58,7 @@ class Chef
private
def cookbooks_api_url
- 'http://cookbooks.opscode.com/api/v1/cookbooks'
+ 'https://supermarket.getchef.com/api/v1/cookbooks'
end
def current_cookbook_data
diff --git a/lib/chef/knife/cookbook_site_list.rb b/lib/chef/knife/cookbook_site_list.rb
index fe83b71388..6fcf7e6064 100644
--- a/lib/chef/knife/cookbook_site_list.rb
+++ b/lib/chef/knife/cookbook_site_list.rb
@@ -41,7 +41,7 @@ class Chef
end
def get_cookbook_list(items=10, start=0, cookbook_collection={})
- cookbooks_url = "http://cookbooks.opscode.com/api/v1/cookbooks?items=#{items}&start=#{start}"
+ cookbooks_url = "https://supermarket.getchef.com/api/v1/cookbooks?items=#{items}&start=#{start}"
cr = noauth_rest.get_rest(cookbooks_url)
cr["items"].each do |cookbook|
cookbook_collection[cookbook["cookbook_name"]] = cookbook
diff --git a/lib/chef/knife/cookbook_site_search.rb b/lib/chef/knife/cookbook_site_search.rb
index b636276cba..ec4d196ee3 100644
--- a/lib/chef/knife/cookbook_site_search.rb
+++ b/lib/chef/knife/cookbook_site_search.rb
@@ -29,7 +29,7 @@ class Chef
end
def search_cookbook(query, items=10, start=0, cookbook_collection={})
- cookbooks_url = "http://cookbooks.opscode.com/api/v1/search?q=#{query}&items=#{items}&start=#{start}"
+ cookbooks_url = "https://supermarket.getchef.com/api/v1/search?q=#{query}&items=#{items}&start=#{start}"
cr = noauth_rest.get_rest(cookbooks_url)
cr["items"].each do |cookbook|
cookbook_collection[cookbook["cookbook_name"]] = cookbook
diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb
index b360cad728..7204ccdb1c 100644
--- a/lib/chef/knife/cookbook_site_share.rb
+++ b/lib/chef/knife/cookbook_site_share.rb
@@ -85,7 +85,7 @@ class Chef
end
def do_upload(cookbook_filename, cookbook_category, user_id, user_secret_filename)
- uri = "http://cookbooks.opscode.com/api/v1/cookbooks"
+ uri = "https://supermarket.getchef.com/api/v1/cookbooks"
category_string = Chef::JSONCompat.to_json({ 'category'=>cookbook_category })
diff --git a/lib/chef/knife/cookbook_site_show.rb b/lib/chef/knife/cookbook_site_show.rb
index d15098e915..c520c00621 100644
--- a/lib/chef/knife/cookbook_site_show.rb
+++ b/lib/chef/knife/cookbook_site_show.rb
@@ -31,14 +31,14 @@ class Chef
def get_cookbook_data
case @name_args.length
when 1
- noauth_rest.get_rest("http://cookbooks.opscode.com/api/v1/cookbooks/#{@name_args[0]}")
+ noauth_rest.get_rest("https://supermarket.getchef.com/api/v1/cookbooks/#{@name_args[0]}")
when 2
- noauth_rest.get_rest("http://cookbooks.opscode.com/api/v1/cookbooks/#{@name_args[0]}/versions/#{name_args[1].gsub('.', '_')}")
+ noauth_rest.get_rest("https://supermarket.getchef.com/api/v1/cookbooks/#{@name_args[0]}/versions/#{name_args[1].gsub('.', '_')}")
end
end
def get_cookbook_list(items=10, start=0, cookbook_collection={})
- cookbooks_url = "http://cookbooks.opscode.com/api/v1/cookbooks?items=#{items}&start=#{start}"
+ cookbooks_url = "https://supermarket.getchef.com/api/v1/cookbooks?items=#{items}&start=#{start}"
cr = noauth_rest.get_rest(cookbooks_url)
cr["items"].each do |cookbook|
cookbook_collection[cookbook["cookbook_name"]] = cookbook
diff --git a/lib/chef/knife/cookbook_site_unshare.rb b/lib/chef/knife/cookbook_site_unshare.rb
index a2828549a0..f095885f15 100644
--- a/lib/chef/knife/cookbook_site_unshare.rb
+++ b/lib/chef/knife/cookbook_site_unshare.rb
@@ -41,7 +41,7 @@ class Chef
confirm "Do you really want to unshare the cookbook #{@cookbook_name}"
begin
- rest.delete_rest "http://cookbooks.opscode.com/api/v1/cookbooks/#{@name_args[0]}"
+ rest.delete_rest "https://supermarket.getchef.com/api/v1/cookbooks/#{@name_args[0]}"
rescue Net::HTTPServerException => e
raise e unless e.message =~ /Forbidden/
ui.error "Forbidden: You must be the maintainer of #{@cookbook_name} to unshare it."
diff --git a/spec/unit/knife/cookbook_site_download_spec.rb b/spec/unit/knife/cookbook_site_download_spec.rb
index 7cd71c2211..76ce6508d7 100644
--- a/spec/unit/knife/cookbook_site_download_spec.rb
+++ b/spec/unit/knife/cookbook_site_download_spec.rb
@@ -26,7 +26,7 @@ describe Chef::Knife::CookbookSiteDownload do
@knife.name_args = ['apache2']
@noauth_rest = double('no auth rest')
@stderr = StringIO.new
- @cookbook_api_url = 'http://cookbooks.opscode.com/api/v1/cookbooks'
+ @cookbook_api_url = 'https://supermarket.getchef.com/api/v1/cookbooks'
@version = '1.0.2'
@version_us = @version.gsub '.', '_'
@current_data = { 'deprecated' => false,
diff --git a/spec/unit/knife/cookbook_site_share_spec.rb b/spec/unit/knife/cookbook_site_share_spec.rb
index a46783274b..902e5f6115 100644
--- a/spec/unit/knife/cookbook_site_share_spec.rb
+++ b/spec/unit/knife/cookbook_site_share_spec.rb
@@ -108,11 +108,11 @@ describe Chef::Knife::CookbookSiteShare do
File.stub(:open).and_return(true)
end
- it 'should post the cookbook to "http://cookbooks.opscode.com"' do
- response_text = {:uri => 'http://cookbooks.opscode.com/cookbooks/cookbook_name'}.to_json
+ it 'should post the cookbook to "https://supermarket.getchef.com"' do
+ response_text = {:uri => 'https://supermarket.getchef.com/cookbooks/cookbook_name'}.to_json
@upload_response.stub(:body).and_return(response_text)
@upload_response.stub(:code).and_return(201)
- Chef::CookbookSiteStreamingUploader.should_receive(:post).with(/cookbooks\.opscode\.com/, anything(), anything(), anything())
+ Chef::CookbookSiteStreamingUploader.should_receive(:post).with(/supermarket\.getchef\.com/, anything(), anything(), anything())
@knife.run
end