Bug 836177

Summary: error message is not clear when using invalid domain name in rhc setup wizard
Product: OKD Reporter: Meng Bo <bmeng>
Component: ocAssignee: N. Harrison Ripps <hripps>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: rmillner
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-13 23:43:42 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 Meng Bo 2012-06-28 09:40:04 UTC
Description of problem:
User without domain exist, using rhc setup, will ask user to create domain first or skip this step. When using invalid domain name in the step, the error message is not meaningful enough.

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

How reproducible:
always

Steps to Reproduce:
1.new user run rhc setup
2.
3.
  
Actual results:
Please enter a namespace or leave this blank if you wish to skip this step:
***
namespace contains non-alphanumeric characters!
Your answer isn't valid (must match #<Proc:0x8a66a8c@/usr/local/share/gems/gems/rhc-0.95.5/lib/rhc/wizard.rb:391 (lambda)>).
?  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
maximum namespace size is 16 characters
Your answer isn't valid (must match #<Proc:0x8a66a8c@/usr/local/share/gems/gems/rhc-0.95.5/lib/rhc/wizard.rb:391 (lambda)>).
?  


Expected results:
The error message should be clear and meaningful.

Additional info:

Comment 1 Clayton Coleman 2012-06-28 13:45:11 UTC
Yikes!

Comment 2 N. Harrison Ripps 2012-07-06 18:59:21 UTC
Our CLI interactions are based on a gem called 'commander', which in turn uses a gem called 'highline' to handle question-and-answer sequences. Highline's default behavior is to show the question's validation rule as part of its error message feedback.

In this case, the validation rule happens to be a Proc, and so the resultant default error message is nonsensical.

I've fixed the problem by setting an understandable response value for the question and providing some formatting cues for good visual presentation. Additionally, I've removed a redundant block of code by adding a condition to the question's 'while' loop.

Comment 3 N. Harrison Ripps 2012-07-09 14:14:16 UTC
Ready for QA.

Comment 4 Meng Bo 2012-07-10 01:52:40 UTC
Verified on rhc-0.95.11, issue fixed.

=============

Please enter a namespace or leave this blank if you wish to skip this step:
%%%
namespace contains non-alphanumeric characters!
The namespace value must contain only letters and/or numbers (A-Za-z0-9):
qwertyuiopwertyuiopqwertyuiop
maximum namespace size is 16 characters
The namespace value must contain only letters and/or numbers (A-Za-z0-9):
jboss

Namespace is not allowed.  Please choose another.
Please enter a namespace or leave this blank if you wish to skip this step: