Bug 870377 - Need to update the command output of set the scaling range of a nonexisting cartridge
Need to update the command output of set the scaling range of a nonexisting c...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-26 05:58 EDT by Rony Gong
Modified: 2015-05-14 22:07 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-13 19:53:51 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rony Gong 2012-10-26 05:58:44 EDT
Description of problem:
When use 
$ rhc cartridge status -a qsphp -c mong 
  Invalid cartridge specified: 'mong'. Valid cartridges are (mongodb-2.2, haproxy-1.4). 

But when use:
$ rhc cartridge scale -a qsphp -c mong  --min 2
Invalid cartridge specified: 'mong'. No cartridges have been added to this app.
so need to update the output to the same with rhc cartridge status

Version-Release number of selected component (if applicable):
devenv_2385
client(build from devenv_2385)

How reproducible:
always

Steps to Reproduce:
1.Create scalable app
2.Set the scaling range of an nonexisting cartridge for this app
rhc cartridge scale -a qsphp -c mong  --min 2
  
Actual results:
[qgong@localhost dev]$ rhc cartridge scale -a qsphp -c mong  --min 2
Password: 
Invalid cartridge specified: 'mong'. No cartridges have been added to this app.


Expected results:
[qgong@localhost dev]$ rhc cartridge scale -a qsphp -c mong  --min 2
Password: 
Invalid cartridge specified: 'mong'. Valid cartridges are (mongodb-2.2, haproxy-1.4).

 
Additional info:
Both non_scalable and scalable app have this issue.
Comment 1 Rony Gong 2012-10-29 03:03:02 EDT
Also need modify this error:
No response for use REST_API to set an nonexisting cartridge
 [qgong@localhost dev]$ curl -k -X PUT -H 'Accept: application/xml' --user qgong@redhat.com:111111  https://ec2-107-20-129-203.compute-1.amazonaws.com/boker/rest/domains/qgong3/applications/qsjbossews/cartridges/ui-9 -d scales_from=6 -d scales_to=4
[qgong@localhost dev]$
Comment 2 Clayton Coleman 2012-12-05 19:21:04 EST
2012-12-05 19:18:02.135 [INFO ] Started PUT "/broker/rest/domains/test64199375/applications/test61489456/cartridges/ui-9" for 66.187.233.202 at 2012-12-05 19:18:02 -0500 (pid:2893)
2012-12-05 19:18:02.138 [INFO ] Processing by EmbCartController#update as JSON (pid:2893)
2012-12-05 19:18:02.138 [INFO ] Parameters: {"scales_from"=>"6", "scales_to"=>"4", "domain_id"=>"test64199375", "application_id"=>"test61489456", "id"=>"ui-9"} (pid:2893)
2012-12-05 19:18:02.139 [DEBUG] MongoDataStore.find(CloudUser, test59249646@example.com, test59249646@example.com) (pid:2893)
2012-12-05 19:18:02.195 [DEBUG] [REQ_ID=82ef37d7f1d34fab90060b464d0bb702] ACTION=UPDATE_CARTRIDGE Cartridge 'ui-9' for application 'test61489456' not found (pid:2893)
2012-12-05 19:18:02.196 [INFO ] Completed 204 No Content in 58ms (pid:2893)

I don't know what the correct error code for this is but it should probably be 404 or 409 - but 404 makes more sense.

Also, if I send ui only, i get HTML error page (no matching routes).  Both scenarios should be 404 (missing cart, PUT to non existent cart)
Comment 3 Dan McPherson 2013-01-26 00:17:22 EST
Broker issue fixed in.  Now the client outputs:

Cartridge 'mong' cannot be found in application 'danmcp11'.

If anything was more correct it would be:

Cartridge 'mong' cannot be found in application 'danmcp11'.  Valid cartridges are (php-5.3).



Sending back to the client in case that's what they intend.
Comment 4 Clayton Coleman 2013-01-31 01:40:00 EST
Meh.  Lots of work, edge case.  We'll come back to this later in the CLI as a story. ON_QA'd for just the core scenario.
Comment 5 Rony Gong 2013-01-31 05:32:39 EST
Verified on devenv_2751
[qgong@localhost dev]$ rhc cartridge status -a qsphp -c mong 
Password: 
Cartridge 'mong' cannot be found in application 'qsphp'.  Valid cartridges are (haproxy-1.4, mongodb-2.2).

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