Bug 889952 - [fork][model refactor] Show incorrect prompt when getting cartridge's status with non-existent cartridge via REST API
Summary: [fork][model refactor] Show incorrect prompt when getting cartridge's status...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Master
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Lili Nader
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-24 06:33 UTC by Wei Sun
Modified: 2015-05-15 00:53 UTC (History)
2 users (show)

Fixed In Version: fork_ami_refctr1_381
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-13 23:46:45 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Wei Sun 2012-12-24 06:33:22 UTC
Description of problem:
Create an application and add a cartridge to this application,try to get cartridge's status with non-existent cartridge via REST API,but can not show correct prompt,will show "Application  not found for domain ". Should show "Cartridge not found for application "

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

How reproducible:
always

Steps to Reproduce:
1.create an app
2.add a cartridge to this app
3.get cartridge's status with non-existent cartridge via REST API
  
Actual results:
[sunwei@dhcp-8-229 dev]$ curl -k -H "Accept:application/xml" --user "wsun@redhat.com:redhat" https://ec2-23-20-194-126.compute-1.amazonaws.com/broker/rest/domains/wsunsunn/applications/phpscaletest/cartridges/mognodb-2.2?include=status_messages
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>not_found</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>error</severity>
      <text>Application 'phpscaletest' not found for domain 'wsunsunn'</text>
      <exit-code>101</exit-code>
      <field nil="true"></field>
    </message>
  </messages>
  <version>1.3</version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
  </supported-api-versions>
</response>


Expected results:
Should show like 
<text>Cartridge mongodb-2.2 not found for application phpscaletest</text>

Additional info:
[sunwei@dhcp-8-229 ~]$ rhc app show phpscaletest
Password: 

phpscaletest @ http://phpscaletest-wsunsunn.dev.rhcloud.com/ (uuid: 50d7ea0049629bf8730003aa)
=============================================================================================
  Created: 5:37 AM
  Git URL: ssh://50d7ea0049629bf8730003aa@phpscaletest-wsunsunn.dev.rhcloud.com/~/git/phpscaletest.git/
  SSH:     50d7ea0049629bf8730003aa@phpscaletest-wsunsunn.dev.rhcloud.com

  php-5.3
  =======

  haproxy-1.4
  ===========

  mysql-5.1
  =========

Comment 1 Wei Sun 2013-01-04 03:09:53 UTC
This bug is not fixed on fork_ami_refctr1_373 ,so assign back it

Result:
[sunwei@dhcp-8-229 ~]$ curl -k -X GET -H 'Accept: application/xml'   --user wsun@redhat.com:redhat https://ec2-23-22-23-181.compute-1.amazonaws.com/broker/rest/domains/wsunsun/applications/phpt/cartridges/mongodb-2.2?include=status_messages
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>not_found</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>error</severity>
      <text>Application 'phpt' not found for domain 'wsunsun'</text>
      <exit-code>101</exit-code>
      <field nil="true"></field>
    </message>
  </messages>
  <version>1.3</version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
  </supported-api-versions>
</response>

[sunwei@dhcp-8-229 ~]$ rhc app show phpt
Password: 

phpt @ http://phpt-wsunsun.dev.rhcloud.com/ (uuid: 50e63a142a5d891507000032)
============================================================================
  Created:   2:10 AM
  Gear Size: small
  Git URL:   ssh://50e63a142a5d891507000032@phpt-wsunsun.dev.rhcloud.com/~/git/phpt.git/
  SSH:       50e63a142a5d891507000032@phpt-wsunsun.dev.rhcloud.com

  php-5.3 (PHP 5.3)
  =================

  haproxy-1.4 (HAProxy 1.4)
  =========================

  mysql-5.1 (MySQL Database 5.1)
  ==============================
    Connection URL: mysql://127.0.253.1:3306/
    Database Name:  phpt
    Password:       ZPgUVt6Lz-1U
    Username:       admin

Comment 2 Lili Nader 2013-01-04 20:38:51 UTC
fixd in fork_ami_refctr1_381

Comment 3 Wei Sun 2013-01-05 02:18:37 UTC
verified in fork_ami_refctr1_381


Result:

[sunwei@dhcp-8-229 dev]$ curl -k -X GET -H 'Accept: application/xml'  --user wsun@redhat.com:redhat https://ec2-23-22-151-166.compute-1.amazonaws.com/broker/rest/domains/wsun1315/applications/phptest/cartridges/mongodb-2.2?include=status_messages
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>not_found</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>error</severity>
      <text>Cartridge 'mongodb-2.2' not found for application 'phptest'</text>
      <exit-code>129</exit-code>
      <field nil="true"></field>
    </message>
  </messages>
  <version>1.3</version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
  </supported-api-versions>
</response>


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