Bug 961105 - rhc app show --gears does not align columns correctly for idle or stopped states
rhc app show --gears does not align columns correctly for idle or stopped states
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Justin Harris
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-08 15:44 EDT by Justin Harris
Modified: 2015-05-14 22:22 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-11 00:02:45 EDT
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 Justin Harris 2013-05-08 15:44:01 EDT
Description of problem:
Tabular output from "rhc app show <name> --gears" is misaligned if the state is not "started"  


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


How reproducible:
Always

Steps to Reproduce:
1.  Create a scaling app
2.  Add one or more additional cartridges
3.  Idle (or stop) one or more gears
4.  run "rhc app show <name> --gears"
  
Actual results:
Here is example output:
ID                               State   Cartridges          Size  SSH URL
-------------------------------- ------- ------------------- ----- -----------------------------------------------------------------------------------------
518a7a80e627270b2f000002         idle php-5.3 haproxy-1.4 small 518a7a80e627270b2f000002@foo-jharris.dev.rhcloud.com
379e958eb7fb11e2bcc912313d0836f7 idle mongodb-2.2         small 379e958eb7fb11e2bcc912313d0836f7@379e958eb7fb11e2bcc912313d0836f7-jharris.dev.rhcloud.com
518a9376e627270b2f000003         stopped mysql-5.1           small 518a9376e627270b2f000003@518a9376e627270b2f000003-jharris.dev.rhcloud.com


Expected results:
The state output should be padded correctly:

ID                               State   Cartridges          Size  SSH URL
-------------------------------- ------- ------------------- ----- -----------------------------------------------------------------------------------------
518a7a80e627270b2f000002         idle    php-5.3 haproxy-1.4 small 518a7a80e627270b2f000002@foo-jharris.dev.rhcloud.com
379e958eb7fb11e2bcc912313d0836f7 idle    mongodb-2.2         small 379e958eb7fb11e2bcc912313d0836f7@379e958eb7fb11e2bcc912313d0836f7-jharris.dev.rhcloud.com
518a9376e627270b2f000003         stopped mysql-5.1           small 518a9376e627270b2f000003@518a9376e627270b2f000003-jharris.dev.rhcloud.com


Additional info:
I suspect that the coloring is affecting the padding calculation.
Comment 1 Clayton Coleman 2013-05-18 20:07:04 EDT
String format can't handle ansi sequences, which means it puts in the wrong padding. 

Fixed in https://github.com/openshift/rhc/pull/387
Comment 2 joycezhang 2013-05-20 02:15:35 EDT
Verified this bug with rhc-1.9.2 built from devenv_3246, the column are aligned correcly when showing with stopped or idled gears as below
# rhc app show -a app7 --gears
ID                               State   Cartridges            Size  SSH URL
-------------------------------- ------- --------------------- ----- -------------------------------------------------------------------------
f506cd36c10f11e2a39622000a8d9cd5 started perl-5.10 haproxy-1.4 small f506cd36c10f11e2a39622000a8d9cd5@app7-dmtest1.dev.rhcloud.com
5199ba43d814ae0a76000009         stopped postgresql-8.4        small 5199ba43d814ae0a76000009@5199ba43d814ae0a76000009-dmtest1.dev.rhcloud.com
5199ba8fd814ae0a7600000a         idle    mysql-5.1             small 5199ba8fd814ae0a7600000a@5199ba8fd814ae0a7600000a-dmtest1.dev.rhcloud.com

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