diff options
author | Jose Asuncion <jose.asuncion@gmail.com> | 2017-09-26 15:31:52 -0700 |
---|---|---|
committer | Jose Asuncion <jose.asuncion@gmail.com> | 2017-09-26 15:33:05 -0700 |
commit | ed65b42bb5bf587495918cbf509a4aea871720ec (patch) | |
tree | 9d8f1e0876bd6467ff4bc49d9b7a02774643250c /lib/chef/server_api.rb | |
parent | d3cf74513829347db86f451cdd3ecc06bab01072 (diff) | |
download | chef-ed65b42bb5bf587495918cbf509a4aea871720ec.tar.gz |
fix chefstyle
Signed-off-by: Jose Asuncion <jeunito@gmail.com>
Diffstat (limited to 'lib/chef/server_api.rb')
-rw-r--r-- | lib/chef/server_api.rb | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/chef/server_api.rb b/lib/chef/server_api.rb index 3bf0df4880..292e754c4b 100644 --- a/lib/chef/server_api.rb +++ b/lib/chef/server_api.rb @@ -57,20 +57,18 @@ class Chef alias :post_rest :post alias :put_rest :put - def get(path, headers={}) - begin - request(:GET, path, headers) - rescue Net::HTTPServerException => e - if e.response.kind_of?(Net::HTTPNotFound) - begin - FFI_Yajl::Parser.parse(e.response.body) - rescue FFI_Yajl::ParseError => e - raise Chef::Exceptions::NotAChefServerException - end - raise - else - raise + def get(path, headers = {}) + request(:GET, path, headers) + rescue Net::HTTPServerException => e + if e.response.kind_of?(Net::HTTPNotFound) + begin + FFI_Yajl::Parser.parse(e.response.body) + rescue FFI_Yajl::ParseError => e + raise Chef::Exceptions::NotAChefServerException end + raise + else + raise end end |