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

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

David Cantrell wrote:
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()

Looks good to me.




Thanks for the review of all the iscsi patches I recently did!

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