Bug 1489585

Summary: [RFE] cleanup tracebacks: validation with local_interface existence within undercloud.conf file works but with tracebacks
Product: Red Hat OpenStack Reporter: mlammon
Component: instack-undercloudAssignee: James Slagle <jslagle>
Status: CLOSED CURRENTRELEASE QA Contact: Arik Chernetsky <achernet>
Severity: medium Docs Contact:
Priority: medium    
Version: 12.0 (Pike)CC: aschultz, bdobreli, dprince, jcoufal, mburns, rhel-osp-director-maint
Target Milestone: ---Keywords: FutureFeature, UserExperience
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-11 15:01:37 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: 1477650    
Bug Blocks:    

Description mlammon 2017-09-07 20:00:03 UTC
Description of problem:
"openstack undercloud install" recently provided validation if the undercloud.conf file had local_interface set to one that does not exist.  bz 1477650 added this logic to check and make sure the interface exists and fail the undercloud installation.

This now validates the local_interface , however, it contains a couple traceback that should be cleaned up. It was being requested become an RFE to cleanup.

Environment:
instack-undercloud-7.3.1-0.20170830213703.el7ost.noarch
instack-7.0.1-0.20170726180523.9961055.el7ost.noarch
python-tripleoclient-7.2.1-0.20170831202445.0bd00bb.el7ost.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install undercloud with  undercloud.conf local_interface = (interface that does not exist)
2.
3.

Actual results:

openstack undercloud install
2017-06-13 10:37:14,706 INFO: Logging to /home/stack/.instack/install-undercloud.log
2017-06-13 10:37:14,730 INFO: Checking for a FQDN hostname...
2017-06-13 10:37:14,761 INFO: Static hostname detected as undercloud.localdomain
2017-06-13 10:37:14,773 INFO: Transient hostname detected as undercloud.localdomain
2017-06-13 10:37:14,777 ERROR: Undercloud configuration validation failed: Invalid local_interface specified. eth3 is not available.
2017-06-13 10:37:14,777 DEBUG: An exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 1659, in install
    _validate_configuration()
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 753, in _validate_configuration
    _validate_network()
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 700, in _validate_network
    validator.validate_config(params, error_handler)
  File "/usr/lib/python2.7/site-packages/instack_undercloud/validator.py", line 39, in validate_config
    _validate_interface_exists(local_params, error_callback)
  File "/usr/lib/python2.7/site-packages/instack_undercloud/validator.py", line 157, in _validate_interface_exists
    error_callback(message)
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 697, in error_handler
    raise validator.FailedValidation(message)
FailedValidation: Invalid local_interface specified. eth3 is not available.
2017-06-13 10:37:14,778 ERROR:
#############################################################################
Undercloud install failed.

Reason: Invalid local_interface specified. eth3 is not available.

See the previous output for details about what went wrong.  The full install
log can be found at /home/stack/.instack/install-undercloud.log.

#############################################################################

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 1659, in install
    _validate_configuration()
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 753, in _validate_configuration
    _validate_network()
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 700, in _validate_network
    validator.validate_config(params, error_handler)
  File "/usr/lib/python2.7/site-packages/instack_undercloud/validator.py", line 39, in validate_config
    _validate_interface_exists(local_params, error_callback)
  File "/usr/lib/python2.7/site-packages/instack_undercloud/validator.py", line 157, in _validate_interface_exists
    error_callback(message)
  File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 697, in error_handler
    raise validator.FailedValidation(message)
instack_undercloud.validator.FailedValidation: Invalid local_interface specified. eth3 is not available.
Command 'instack-install-undercloud' returned non-zero exit status 1

Expected results:


openstack undercloud install
2017-06-13 10:37:14,706 INFO: Logging to /home/stack/.instack/install-undercloud.log
2017-06-13 10:37:14,730 INFO: Checking for a FQDN hostname...
2017-06-13 10:37:14,761 INFO: Static hostname detected as undercloud.localdomain
2017-06-13 10:37:14,773 INFO: Transient hostname detected as undercloud.localdomain
2017-06-13 10:37:14,777 ERROR: Undercloud configuration validation failed: Invalid local_interface specified. eth3 is not available.
2017-06-13 10:37:14,777 DEBUG: An exception occurred
FailedValidation: Invalid local_interface specified. eth3 is not available.
2017-06-13 10:37:14,778 ERROR:
#############################################################################
Undercloud install failed.

Reason: Invalid local_interface specified. eth3 is not available.

See the previous output for details about what went wrong.  The full install
log can be found at /home/stack/.instack/install-undercloud.log.

#############################################################################


Additional info: