diff options
author | Chris Doherty <cdoherty@chef.io> | 2015-11-02 10:54:39 -0800 |
---|---|---|
committer | Chris Doherty <cdoherty@chef.io> | 2015-11-02 10:54:39 -0800 |
commit | 511fd8947b146e9a9899a2641682d5dda963cc01 (patch) | |
tree | e2882083db8861d7591b8344ad98dbb464deb931 | |
parent | abf611d3bd01af719a286925fb4875a92cad98a9 (diff) | |
download | chef-zero-511fd8947b146e9a9899a2641682d5dda963cc01.tar.gz |
Reverse an if..else for consistency (returning 404 in the if).
-rw-r--r-- | lib/chef_zero/endpoints/organization_policies_endpoint.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef_zero/endpoints/organization_policies_endpoint.rb b/lib/chef_zero/endpoints/organization_policies_endpoint.rb index b799fa7..c1848f5 100644 --- a/lib/chef_zero/endpoints/organization_policies_endpoint.rb +++ b/lib/chef_zero/endpoints/organization_policies_endpoint.rb @@ -40,11 +40,11 @@ module ChefZero # /policies/:policy_name/revisions/:revision_id if request.rest_path[-2] == "revisions" - if exists_data?(request, nil) + if !exists_data?(request, nil) + return error(404, "Revision ID #{request.rest_path.last} not found" ) + else data = get_data(request) return already_json_response(200, data) - else - return error(404, "Revision ID #{request.rest_path.last} not found" ) end end end |