Bug 798884 - [REST API] No exit-code and incorrect application id is shown when calling gear REST API
[REST API] No exit-code and incorrect application id is shown when calling ge...
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ravi Sankar Penta
libra bugs
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2012-03-01 02:50 EST by Johnny Liu
Modified: 2014-06-18 02:54 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-03-19 14:23:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Johnny Liu 2012-03-01 02:50:23 EST
Description of problem:
Give a non-existing app name (phptest1) on purpose upon calling rest api,

Version-Release number of selected component (if applicable):

How reproducible:

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@redhat.com: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"?>
  <type nil="true"></type>
      <field nil="true"></field>
      <exit-code nil="true"></exit-code>
      <text>Application 70226569206200 not found.</text>
  <data nil="true"></data>

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:
  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.")
      respond_with @reply, :status => @reply.status

app_id should be changed to id
#{id} should be changed to #{app_id}
Comment 1 Ravi Sankar 2012-03-15 15:06:20 EDT
Comment 2 Johnny Liu 2012-03-16 07:25:56 EDT
Verified this bug with devenv_stage_144, and PASS.

$ curl -k -X GET -H "Accept: application/xml" --user jialiu@redhat.com: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"?>
  <data nil="true"></data>
  <type nil="true"></type>
      <text>Application 'phptest1' not found.</text>
      <field nil="true"></field>

Note You need to log in before you can comment on or make changes to this bug.