Bug 1306032

Summary: [TripleO] Config options in the fusor undercloud installer should have validation
Product: Red Hat Quickstart Cloud Installer Reporter: Thom Carlin <tcarlin>
Component: fusor-installerAssignee: Jesus M. Rodriguez <jesusr>
Status: CLOSED DEFERRED QA Contact: Tasos Papaioannou <tpapaioa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.0CC: jmatthew, tpapaioa, tsanders
Target Milestone: TP3Keywords: Triaged
Target Release: 1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1325369 (view as bug list) Environment:
Last Closed: 2019-02-25 17:28:51 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:
Bug Depends On:    
Bug Blocks: 1325369    

Description Thom Carlin 2016-02-09 21:21:22 UTC
Description of problem:

Config options in the fusor undercloud installer should have validation.  Fields currently accept any and everything

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

TP2 RC9

How reproducible:

100%

Steps to Reproduce:
1. Install TripleO ISO
2. Log in to run launch-fusor-undercloud-installer
3. Enter "A" for network gateway IP address

Actual results:

Traceback:
File "/usr/sbin/fusor-undercloud-configurator", line 200, in <module>
if expected_subnet[i] == inputted_subnet[i]:
IndexError: list index out of range

Expected results:

Bad values should not be accepted

Additional info:

Similarly for other input values

Comment 1 John Matthews 2016-04-04 16:24:04 UTC
Please test with TP3 RC2+

Comment 2 Tasos Papaioannou 2016-04-04 19:28:36 UTC
A few issues when testing on QCIOOO-7-RHEL-7-20160401.t.3:


1.) If I first enter a blank FQDN, the second prompt gives a default value of 'HOSTNAME', and it rejects any further valid hostname values that I enter:

Set your resolvable Fully Qualified Domain Name: 
Specified hostname is not valid
Set your resolvable Fully Qualified Domain Name: HOSTNAME
Specified hostname is not valid
Set your resolvable Fully Qualified Domain Name: fusor.example.com
Specified hostname is not valid

2.) An invalid numeric hostname is accepted:

Set your resolvable Fully Qualified Domain Name: 1.1.1
Hostname is in valid format, setting hostname

3.) An invalid DNS server IP address is accepted:

Enter the DNS nameserver's IP address to use for the Overcloud: 10.11.5.666
Nameserver IP address is valid

4.) Tracebacks when entering invalid IP addresses on other fields:

We require a block of IP Addresses that we can assign on your network.  Please specify this block using standard slash notation: [192.168.150.0/24] 666.666.666.666/24
Traceback (most recent call last):
  File "/usr/sbin/fusor-undercloud-configurator", line 367, in <module>
    network = ipaddress.ip_network(unicode(input_str), strict=False)
  File "/usr/lib/python2.7/site-packages/ipaddress.py", line 148, in ip_network
    address)
ValueError: u'666.666.666.666/24' does not appear to be an IPv4 or IPv6 network

---

Please specify the IP address of the Openstack Director. Be sure that this IP is on the correct subnet and does not interfere with the block given above. [192.168.150.254] 666.666.666.666
Traceback (most recent call last):
  File "/usr/sbin/fusor-undercloud-configurator", line 386, in <module>
    elif not ipaddress.IPv4Address(unicode(undercloud_ip)) in network:
  File "/usr/lib/python2.7/site-packages/ipaddress.py", line 1279, in __init__
    self._ip = self._ip_int_from_string(addr_str)
  File "/usr/lib/python2.7/site-packages/ipaddress.py", line 1126, in _ip_int_from_string
    raise AddressValueError("%s in %r" % (exc, ip_str))
ipaddress.AddressValueError: Octet 666 (> 255) not permitted in u'666.666.666.666'

---

Please specify the IP Address of the network gateway. This is preferably the router that leads out to the larger network but will default to this machine if not changed, making this machine a critical piece of your OpenStack infrastructure. [192.168.150.1] 666.666.666.666
Traceback (most recent call last):
  File "/usr/sbin/fusor-undercloud-configurator", line 417, in <module>
    elif not ipaddress.IPv4Address(unicode(gateway)) in network:
  File "/usr/lib/python2.7/site-packages/ipaddress.py", line 1279, in __init__
    self._ip = self._ip_int_from_string(addr_str)
  File "/usr/lib/python2.7/site-packages/ipaddress.py", line 1126, in _ip_int_from_string
    raise AddressValueError("%s in %r" % (exc, ip_str))
ipaddress.AddressValueError: Octet 666 (> 255) not permitted in u'666.666.666.666'

5.) If I first enter a blank DNS server address, I see similar behavior to issue #1 above:

Enter the DNS nameserver's IP address to use for the Overcloud: 
Specified nameserver is not a valid IP address
Enter the DNS nameserver's IP address to use for the Overcloud: NAMESERVER
Specified nameserver is not a valid IP address
Enter the DNS nameserver's IP address to use for the Overcloud: 10.5.27.10
Specified nameserver is not a valid IP address
Enter the DNS nameserver's IP address to use for the Overcloud: NAMESERVER

Comment 3 Jesus M. Rodriguez 2016-04-07 19:09:49 UTC
Fixed 1 & 5.  Working on fixing 2.

Comment 4 Jesus M. Rodriguez 2016-04-08 15:07:51 UTC
PR #38 [1] will address the following items:

1) Entering a blank FQDN no longer breaks the state machine.

4) Invalid address for network, Director, and gateway no longer throws traceback. If given a value that causes a traceback, the user is re-prompted for valid input.

5) Entering a blank DNS server address no longer breaks the state machine.

Tracebacks when entering invalid IP addresses on other fields

Items 2 and 3 have been moved to BZ 1325369 [2] to be addressed for GA.


[1] https://github.com/fusor/fusor-undercloud-installer/pull/38
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1325369

Comment 5 John Matthews 2016-04-11 20:43:08 UTC
Addressed in TP3 RC3

Comment 6 Tasos Papaioannou 2016-04-12 21:20:46 UTC
Verified on QCIOOO-7-RHEL-7-20160408.t.1.

Comment 7 Sudhir Mallamprabhakara 2019-02-25 17:28:51 UTC
QCI has sunset. Closing the BZ's