Hide Forgot
Description of problem: Give a non-existing app name (phptest1) on purpose upon calling rest api, Version-Release number of selected component (if applicable): devenv_stage_139 How reproducible: Always Steps to Reproduce: 1. Call gear rest api with a non-existing app name (phptest1) on purpose. $ curl -k -X GET -H 'Accept: application/xml' --user jialiu:214214 https://ec2-184-73-117-151.compute-1.amazonaws.com/broker/rest/domains/jialiu/applications/phptest1/gears <?xml version="1.0" encoding="UTF-8"?> <response> <type nil="true"></type> <version>1.0</version> <messages> <message> <field nil="true"></field> <severity>error</severity> <exit-code nil="true"></exit-code> <text>Application 70226569206200 not found.</text> </message> </messages> <data nil="true"></data> <status>not_found</status> </response> Actual results: 1. No exit-code, according to Bug 787295, every error message should have exit_code. 2. application id is not correct <text>Application 70226569206200 not found.</text> should be <text>Application phptest1 not found.</text> Expected results: exit-code and app id is shown correctly in the output of rest api. Additional info: About application id issue: cloud-sdk/controller/lib/cloud-sdk-controller/app/controllers/gears_controller.rb: <--snip--> def show domain_id = params[:domain_id] app_id = params[:application_id] app = Application.find(@cloud_user,app_id) if app.nil? @reply = RestReply.new(:not_found) message = Message.new(:error, "Application #{id} not found.") @reply.messages.push(message) respond_with @reply, :status => @reply.status <--snip--> app_id should be changed to id or #{id} should be changed to #{app_id}
Fixed.
Verified this bug with devenv_stage_144, and PASS. $ curl -k -X GET -H "Accept: application/xml" --user jialiu:xx https://ec2-50-17-147-234.compute-1.amazonaws.com/broker/rest/domains/jialiu/applications/phptest1/gears <?xml version="1.0" encoding="UTF-8"?> <response> <data nil="true"></data> <status>not_found</status> <version>1.0</version> <type nil="true"></type> <messages> <message> <severity>error</severity> <text>Application 'phptest1' not found.</text> <exit-code>101</exit-code> <field nil="true"></field> </message> </messages> </response>