Bug 1284086

Summary: atomic-openshift-installer crashes on non-ascii hostname input
Product: OpenShift Container Platform Reporter: Evgheni Dereveanchin <ederevea>
Component: InstallerAssignee: Samuel Munilla <smunilla>
Status: CLOSED CURRENTRELEASE QA Contact: Ma xiaoqiang <xiama>
Severity: low Docs Contact:
Priority: medium    
Version: 3.1.0CC: aos-bugs, bleanhar, ghuang, jokerman, mmccomas, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-29 20:58:23 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 Evgheni Dereveanchin 2015-11-20 19:21:15 UTC
Description of problem:
When installing, if a non-ascii text is sent as hostname during Host Configuration, the installer will crash.

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

How reproducible:
Always

Steps to Reproduce:
1. atomic-openshift-installer install
2. press Y
3. press Enter
4. enter a non-ascii symbol (Ж)

Actual results:

Enter hostname or IP address: []: env1-ose3-masterювуьщюдфт
Traceback (most recent call last):
  File "/usr/bin/atomic-openshift-installer", line 9, in <module>
    load_entry_point('ooinstall==3.0.0', 'console_scripts', 'oo-install')()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ooinstall/cli_installer.py", line 542, in install
    oo_cfg = get_missing_info_from_user(oo_cfg)
  File "/usr/lib/python2.7/site-packages/ooinstall/cli_installer.py", line 294, in get_missing_info_from_user
    oo_cfg.hosts = collect_hosts()
  File "/usr/lib/python2.7/site-packages/ooinstall/cli_installer.py", line 108, in collect_hosts
    value_proc=validate_prompt_hostname)
  File "/usr/lib/python2.7/site-packages/click/termui.py", line 89, in prompt
    result = value_proc(value)
  File "/usr/lib/python2.7/site-packages/ooinstall/cli_installer.py", line 37, in validate_prompt_hostname
    'and re-enter it.'.format(hostname))
  File "/usr/lib/python2.7/site-packages/click/exceptions.py", line 71, in __init__
    UsageError.__init__(self, message, ctx)
  File "/usr/lib/python2.7/site-packages/click/exceptions.py", line 38, in __init__
    ClickException.__init__(self, message)
  File "/usr/lib/python2.7/site-packages/click/exceptions.py", line 14, in __init__
    message = message.encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 17: ordinal not in range(128)

Expected results:

Enter hostname or IP address: []: env1-ose3-masterювуьщюдфт
Error: invalid input

Comment 1 Samuel Munilla 2016-01-12 19:31:09 UTC
Should be fixed by https://github.com/openshift/openshift-ansible/pull/1172

Comment 2 Gan Huang 2016-01-26 04:05:26 UTC
Verfied with atomic-openshift-utils-3.0.35-1.git.0.6a386dd.el7aos.noarch

Actual results:

Enter hostname or IP address: Ж
Error: Invalid hostname. Please double-check this value and re-enter it.
Enter hostname or IP address: