diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-02-18 16:27:07 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-02-18 16:27:07 -0800 |
commit | 91c87f8249b4ebc136de64ae453e371d678c884e (patch) | |
tree | e52241a1809f1ce258d5aa10b1bb12b879336936 /lib/chef/knife/cookbook_site_share.rb | |
parent | e24bf812769efe4a4f52b212631af0071d9de3b8 (diff) | |
download | chef-91c87f8249b4ebc136de64ae453e371d678c884e.tar.gz |
whitespaces fixes
addresses Lint/DefEndAlignment and probably more
Diffstat (limited to 'lib/chef/knife/cookbook_site_share.rb')
-rw-r--r-- | lib/chef/knife/cookbook_site_share.rb | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb index ee73bfc26a..560e0669c1 100644 --- a/lib/chef/knife/cookbook_site_share.rb +++ b/lib/chef/knife/cookbook_site_share.rb @@ -131,33 +131,33 @@ class Chef end def do_upload(cookbook_filename, cookbook_category, user_id, user_secret_filename) - uri = "https://supermarket.chef.io/api/v1/cookbooks" - - category_string = Chef::JSONCompat.to_json({ 'category'=>cookbook_category }) - - http_resp = Chef::CookbookSiteStreamingUploader.post(uri, user_id, user_secret_filename, { - :tarball => File.open(cookbook_filename), - :cookbook => category_string - }) - - res = Chef::JSONCompat.from_json(http_resp.body) - if http_resp.code.to_i != 201 - if res['error_messages'] - if res['error_messages'][0] =~ /Version already exists/ - ui.error "The same version of this cookbook already exists on the Opscode Cookbook Site." - exit(1) - else - ui.error "#{res['error_messages'][0]}" - exit(1) - end - else - ui.error "Unknown error while sharing cookbook" - ui.error "Server response: #{http_resp.body}" - exit(1) - end - end - res - end + uri = "https://supermarket.chef.io/api/v1/cookbooks" + + category_string = Chef::JSONCompat.to_json({ 'category'=>cookbook_category }) + + http_resp = Chef::CookbookSiteStreamingUploader.post(uri, user_id, user_secret_filename, { + :tarball => File.open(cookbook_filename), + :cookbook => category_string + }) + + res = Chef::JSONCompat.from_json(http_resp.body) + if http_resp.code.to_i != 201 + if res['error_messages'] + if res['error_messages'][0] =~ /Version already exists/ + ui.error "The same version of this cookbook already exists on the Opscode Cookbook Site." + exit(1) + else + ui.error "#{res['error_messages'][0]}" + exit(1) + end + else + ui.error "Unknown error while sharing cookbook" + ui.error "Server response: #{http_resp.body}" + exit(1) + end + end + res + end end end |