Bug 961105 - rhc app show --gears does not align columns correctly for idle or stopped states
Summary: rhc app show --gears does not align columns correctly for idle or stopped states
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Justin Harris
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-08 19:44 UTC by Justin Harris
Modified: 2015-05-15 02:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-11 04:02:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Justin Harris 2013-05-08 19:44:01 UTC
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.rhcloud.com
379e958eb7fb11e2bcc912313d0836f7 idle mongodb-2.2         small 379e958eb7fb11e2bcc912313d0836f7.rhcloud.com
518a9376e627270b2f000003         stopped mysql-5.1           small 518a9376e627270b2f000003.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.rhcloud.com
379e958eb7fb11e2bcc912313d0836f7 idle    mongodb-2.2         small 379e958eb7fb11e2bcc912313d0836f7.rhcloud.com
518a9376e627270b2f000003         stopped mysql-5.1           small 518a9376e627270b2f000003.rhcloud.com


Additional info:
I suspect that the coloring is affecting the padding calculation.

Comment 1 Clayton Coleman 2013-05-19 00:07:04 UTC
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 06:15:35 UTC
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.rhcloud.com
5199ba43d814ae0a76000009         stopped postgresql-8.4        small 5199ba43d814ae0a76000009.rhcloud.com
5199ba8fd814ae0a7600000a         idle    mysql-5.1             small 5199ba8fd814ae0a7600000a.rhcloud.com


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