Bug 1306032 - [TripleO] Config options in the fusor undercloud installer should have validation
[TripleO] Config options in the fusor undercloud installer should have valida...
Status: VERIFIED
Product: Red Hat Quickstart Cloud Installer
Classification: Red Hat
Component: fusor-installer (Show other bugs)
1.0
Unspecified Unspecified
unspecified Severity medium
: TP3
: 1.0
Assigned To: Jesus M. Rodriguez
Tasos Papaioannou
: Triaged
Depends On:
Blocks: 1325369
  Show dependency treegraph
 
Reported: 2016-02-09 16:21 EST by Thom Carlin
Modified: 2016-08-12 16:08 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1325369 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Thom Carlin 2016-02-09 16:21:22 EST
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 12:24:04 EDT
Please test with TP3 RC2+
Comment 2 Tasos Papaioannou 2016-04-04 15:28:36 EDT
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 15:09:49 EDT
Fixed 1 & 5.  Working on fixing 2.
Comment 4 Jesus M. Rodriguez 2016-04-08 11:07:51 EDT
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 16:43:08 EDT
Addressed in TP3 RC3
Comment 6 Tasos Papaioannou 2016-04-12 17:20:46 EDT
Verified on QCIOOO-7-RHEL-7-20160408.t.1.

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