diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-10-17 14:53:13 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-10-17 14:53:13 -0700 |
commit | 5cae811a9684d2994c444cefd0e0c80e5db38247 (patch) | |
tree | be754dd283394c05ae880ea9f9fcabbb7891913d | |
parent | 24522cdb406e1de753e336b2036c02df9f611e85 (diff) | |
parent | 5ada395e43803b8ecab33548790d3b2ca8f815f3 (diff) | |
download | chef-5cae811a9684d2994c444cefd0e0c80e5db38247.tar.gz |
Merge pull request #2240 from opscode/sersut/backport-supermarket-switch
Backport cookbooks.opscode.com -> supermarket change to 11-stable.
-rw-r--r-- | lib/chef/knife/cookbook_site_download.rb | 2 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_site_list.rb | 2 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_site_search.rb | 2 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_site_share.rb | 2 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_site_show.rb | 6 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_site_unshare.rb | 2 | ||||
-rw-r--r-- | spec/unit/knife/cookbook_site_download_spec.rb | 3 | ||||
-rw-r--r-- | spec/unit/knife/cookbook_site_share_spec.rb | 6 |
8 files changed, 13 insertions, 12 deletions
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 2de0f9c5f3..eaa30ea743 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 faf58f7bc7..1b0f9f53d3 100644 --- a/spec/unit/knife/cookbook_site_download_spec.rb +++ b/spec/unit/knife/cookbook_site_download_spec.rb @@ -26,7 +26,8 @@ describe Chef::Knife::CookbookSiteDownload do @knife.name_args = ['apache2'] @noauth_rest = double('no auth rest') @stdout = StringIO.new - @cookbook_api_url = 'http://cookbooks.opscode.com/api/v1/cookbooks' + @stderr = StringIO.new + @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 7e4a65ae7e..77dce9b175 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 = Chef::JSONCompat.to_json({:uri => 'http://cookbooks.opscode.com/cookbooks/cookbook_name'}) + 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 |