summaryrefslogtreecommitdiffstats
path: root/network.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-11-07 15:35:29 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-11-08 09:14:17 -1000
commit6b1a0d0f1774531ecd36e88e0b6c1756c431bb8c (patch)
tree1e34fcaf52a10e4d5123ed344bf029e4a919eb2d /network.py
parent620bdb978bfe46f96f04865e776edd15728b85d8 (diff)
downloadanaconda-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.py5
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()