Bug 1136015 - Installation of second host failed, if given incorrect FQDN of first host for answer file
Summary: Installation of second host failed, if given incorrect FQDN of first host for...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-hosted-engine-setup
Version: 3.5
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
: 3.5.0
Assignee: Sandro Bonazzola
QA Contact: meital avital
URL:
Whiteboard: integration
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-01 13:01 UTC by Artyom
Modified: 2014-10-17 12:35 UTC (History)
6 users (show)

Fixed In Version: ovirt-3.5.0_rc2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-17 12:35:11 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)
setup log (220.95 KB, text/plain)
2014-09-01 13:01 UTC, Artyom
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 32392 0 master MERGED Add additional exception to prevent socket.gaierror error Never
oVirt gerrit 32588 0 ovirt-hosted-engine-setup-1.2 MERGED Add additional exception to prevent socket.gaierror error Never

Description Artyom 2014-09-01 13:01:50 UTC
Created attachment 933363 [details]
setup log

Description of problem:
Installation of second host failed, if given incorrect FQDN of first host for answer file

Version-Release number of selected component (if applicable):
ovirt-hosted-engine-setup-1.2.0-0.1.master.20140820130617.gitd832f86.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. Have hosted-engine environment with one host
2. Add second host and give incorrect FQDN, when deployment ask to provide host to download answer file
3.

Actual results:
[ ERROR ] Failed to execute stage 'Environment customization': local variable 'transport' referenced before assignment
And deployment failed and not give possibility to re-enter FQDN

Expected results:
Appear error that FQDN not correct but deployment give you possibility to re-enter FQDN or to Abort setup

Additional info:

Comment 1 Artyom 2014-09-01 16:27:19 UTC
In this case we have catch to narrow exception:
try:
                transport = paramiko.Transport((self.environment[
                    ohostedcons.FirstHostEnv.FQDN
                ], 22))
                valid = True
            except paramiko.SSHException as e:
but in transport we have socket.getaddrinfo(hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM) that can drop socket.gaierror in case of not correct hostname, and so we jump forward to 
finally:
    transport.close() and we have 
UnboundLocalError: local variable 'transport' referenced before assignment

So one of solutions it to check if FQDN available before run:
transport = paramiko.Transport((self.environment[
                    ohostedcons.FirstHostEnv.FQDN
                ], 22))

or just add another except (paramiko.SSHException, socket.gaierror) as e:

Comment 2 Sandro Bonazzola 2014-10-17 12:35:11 UTC
oVirt 3.5 has been released and should include the fix for this issue.


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