diff options
author | David Cantrell <dcantrell@redhat.com> | 2008-11-07 15:35:29 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2008-11-08 09:14:17 -1000 |
commit | 6b1a0d0f1774531ecd36e88e0b6c1756c431bb8c (patch) | |
tree | 1e34fcaf52a10e4d5123ed344bf029e4a919eb2d /network.py | |
parent | 620bdb978bfe46f96f04865e776edd15728b85d8 (diff) | |
download | anaconda-6b1a0d0f1774531ecd36e88e0b6c1756c431bb8c.tar.gz anaconda-6b1a0d0f1774531ecd36e88e0b6c1756c431bb8c.tar.xz anaconda-6b1a0d0f1774531ecd36e88e0b6c1756c431bb8c.zip |
Prevent traceback for vnc installs on KVM guests (#470559)
If you are installing in a KVM guest and pass 'vnc' on the boot line,
getDefaultHostname() in network.py will traceback because anaconda.id
contains nothing in this particular use case. Wrap the offending
line in try/except and fall back on None if we can't pick the hostname
from anaconda.id.network.
For KVM installs, this causes vnc.py to report 'Please connect your
vnc client to IPADDRESS:DISPLAY to begin the install', which is good
enough for me.
Diffstat (limited to 'network.py')
-rw-r--r-- | network.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/network.py b/network.py index c986cda7c..45dc40880 100644 --- a/network.py +++ b/network.py @@ -112,7 +112,10 @@ def getDefaultHostname(anaconda): if hn and hn != 'localhost' and hn != 'localhost.localdomain': return hn - hn = anaconda.id.network.hostname + try: + hn = anaconda.id.network.hostname + except: + hn = None if not hn or hn == '(none)' or hn == 'localhost' or hn == 'localhost.localdomain': hn = socket.gethostname() |