[PATCH] Prevent traceback for vnc installs on KVM guests (#470559)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 network.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/network.py b/network.py
index c986cda..45dc408 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()
-- 
1.6.0.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux