Bug 1769368

Summary: openstack undercloud deploy throws exception on typo in subnets parameter in undercloud.conf
Product: Red Hat OpenStack Reporter: David Juran <djuran>
Component: python-tripleoclientAssignee: Alex Schultz <aschultz>
Status: CLOSED ERRATA QA Contact: Sasha Smolyak <ssmolyak>
Severity: low Docs Contact:
Priority: low    
Version: 15.0 (Stein)CC: apetrich, aschultz, emacchi, hbrock, jbuchta, jschluet, jslagle, mburns, pweeks
Target Milestone: betaKeywords: Reopened, Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-tripleoclient-12.3.2-0.20200130192329.78ac810.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-29 07:49:26 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 David Juran 2019-11-06 13:22:47 UTC
Description of problem:
I made a typo in my undercloud.conf:

subnets = ctlplane-subnet, ctlplane-subnet-0, ctlplane-subnet-1, ctlplane-subnet-3

where the last should have been subnet-2 not subnet-3.

This resulted in the following traceback:

[stack@undercloud ~]$ openstack undercloud install
Exception occured while running the command
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/tripleoclient/command.py", line 32, in run
    super(Command, self).run(parsed_args)
  File "/usr/lib/python3.6/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python3.6/site-packages/cliff/command.py", line 184, in run
    return_code = self.take_action(parsed_args) or 0
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/undercloud.py", line 130, in take_action
    dry_run=parsed_args.dry_run)
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/undercloud_config.py", line 394, in prepare_undercloud_deploy
    _process_network_args(env_data)
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/undercloud_config.py", line 332, in _process_network_args
    env['IronicInspectorSubnets'] = _generate_inspection_subnets()
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/undercloud_config.py", line 227, in _generate_inspection_subnets
    env_dict['netmask'] = str(netaddr.IPNetwork(s.cidr).netmask)
  File "/usr/lib/python3.6/site-packages/netaddr/ip/__init__.py", line 928, in __init__
    implicit_prefix, flags)
  File "/usr/lib/python3.6/site-packages/netaddr/ip/__init__.py", line 823, in parse_ip_network
    raise TypeError('unexpected type %s for addr arg' % type(addr))
TypeError: unexpected type <class 'NoneType'> for addr arg
unexpected type <class 'NoneType'> for addr arg


Admittedly the typo was my bad but something a little but more informant of where to find the typo would be appreciated.



Version-Release number of selected component (if applicable):
python3-tripleoclient-11.5.1-0.20190829110437.9b9b5aa.el8ost.noarch

Comment 1 Alex Schultz 2019-12-19 22:37:51 UTC
If you're missing the entire subnet section, you should get something like "oslo_config.cfg.NoSuchOptError: no such option subnet1 in group [DEFAULT]". However if you include an incorrect ip address or an empty value, you can get a failure when we try and parse the ip information.

Comment 2 Emilien Macchi 2020-02-05 21:58:59 UTC
Alex fixed it in Train:https://review.opendev.org/#/c/700987
Would that be enough for you?

Comment 3 David Juran 2020-02-10 15:03:59 UTC
Yes, Train will be fine. 
Thanks a lot (-:

Comment 10 errata-xmlrpc 2020-07-29 07:49:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3148