Bug 856056

Summary: Messages returned from CLI are messed up on windows 7
Product: OKD Reporter: Jianwei Hou <jhou>
Component: ocAssignee: John (J5) Palmieri <johnp>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: jkeck, johnp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 0.98.14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-17 21:29:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jianwei Hou 2012-09-11 05:30:02 UTC
Description of problem:
run rhc command on windows 7, when some command fails, the messages returned are messed up

Version-Release number of selected component (if applicable):
OS: Windows 7
ruby 1.9.3
CLI: rhc-0.98.13

How reproducible:
Always

Steps to Reproduce:
1. Try to run 'rhc domain', 'rhc sshkey', 'rhc server' with some invalid arguments or make the command fail. 
rhc domain create -a 
rhc server
rhc sshkey add rsa id_rsa

  
Actual results:
C:\Users\window7\.ssh>rhc domain create -a
&#8592;[31minvalid option: -a&#8592;[0m
 
C:\Users\window7\.ssh>rhc server
&#8592;[32mAll systems running fine&#8592;[0m
 
C:\Users\window7\.ssh>rhc sshkey add rsa id_rsa
Password: ******
 
&#8592;[31mInvalid key type.  Valid types are ssh-rsa or ssh-dss.&#8592;[0m

Expected results:
The messages should be clear not messed up

Additional info:

Comment 1 Jianwei Hou 2012-09-11 11:48:37 UTC
This bug is also reproduced on Windows XP

Comment 2 John (J5) Palmieri 2012-09-11 13:52:34 UTC
Looks like windows disables ansi consoles by default.  I suggest turning off colors in highline for windows systems

Comment 3 John Poelstra 2012-09-11 17:06:26 UTC
fix pushed, will update this bug soon

Comment 4 John (J5) Palmieri 2012-09-11 23:33:44 UTC
We turn off colors for Windows now.  There is a FIXME to see if highline actually supports window console colors instead of just ANSI but it is low down in the list since the color console is simply an enhancement and not required.

Comment 5 Jianwei Hou 2012-09-12 02:40:05 UTC
Verified with rhc-0.98.14 on Windows 7

Step:
1. Try to run 'rhc domain', 'rhc sshkey', 'rhc server' with some invalid arguments or make the command fail. 
rhc domain create -a 
rhc server
rhc sshkey add rsa id_rsa

Result:
C:\Users\window7\.ssh>rhc domain create -a
invalid option: -a

C:\Users\window7\.ssh>rhc server
All systems running fine
 
C:\Users\window7\.ssh>rhc sshkey add rsakey id_rsa
Password: **
 
Invalid key type.  Valid types are ssh-rsa or ssh-dss.

Now the messages are clear, so verified.