rpms/virt-manager/FC-6 virt-manager-hostname-resolution-errors.patch, NONE, 1.1 virt-manager.spec, 1.12, 1.13

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Dec 1 21:20:33 UTC 2006


Author: berrange

Update of /cvs/dist/rpms/virt-manager/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv23274

Modified Files:
	virt-manager.spec 
Added Files:
	virt-manager-hostname-resolution-errors.patch 
Log Message:
Deal with errors during hostname lookup (bz 216975)

virt-manager-hostname-resolution-errors.patch:
 connection.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

--- NEW FILE virt-manager-hostname-resolution-errors.patch ---
diff -ru virt-manager-0.2.6.orig/src/virtManager/connection.py virt-manager-0.2.6.new/src/virtManager/connection.py
--- virt-manager-0.2.6.orig/src/virtManager/connection.py	2006-11-09 14:15:42.000000000 -0500
+++ virt-manager-0.2.6.new/src/virtManager/connection.py	2006-12-01 16:16:12.000000000 -0500
@@ -57,7 +57,12 @@
 
     def get_name(self):
         if self.uri == "xen" or self.uri == "Xen" or (self.uri is None):
-            (hostname, aliases, ipaddrs) = gethostbyaddr(gethostname())
+            hostname = "localhost"
+            try:
+                (host, aliases, ipaddrs) = gethostbyaddr(gethostname())
+                hostname = host
+            except:
+                logging.warning("Unable to resolve local hostname for machine")
             return "Xen: " + hostname
         else:
             return self.uri


Index: virt-manager.spec
===================================================================
RCS file: /cvs/dist/rpms/virt-manager/FC-6/virt-manager.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- virt-manager.spec	10 Nov 2006 00:06:30 -0000	1.12
+++ virt-manager.spec	1 Dec 2006 21:20:31 -0000	1.13
@@ -8,7 +8,7 @@
 
 Name: virt-manager
 Version: 0.2.6
-Release: 1%{_extra_release}
+Release: 2%{_extra_release}
 Summary: Virtual Machine Manager
 
 Group: Applications/Emulators
@@ -17,6 +17,7 @@
 Source0: http://virt-manager.et.redhat.com/download/sources/%{name}/%{name}-%{version}.tar.gz
 Source1: %{name}.pam
 Source2: %{name}.console
+Patch1: virt-manager-hostname-resolution-errors.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 # These two are just the oldest version tested
@@ -64,6 +65,7 @@
 
 %prep
 %setup -q
+%patch1 -p1
 
 %build
 %configure
@@ -146,6 +148,9 @@
 %{_datadir}/dbus-1/services/%{name}.service
 
 %changelog
+* Fri Dec  1 2006 Daniel P. Berrange <berrange at redhat.com> - 0.2.6-2.fc6
+- Handle errors when hostname resolution fails to avoid app exiting (bz 216975)
+
 * Thu Nov  9 2006 Daniel P. Berrange <berrange at redhat.com> - 0.2.6-1.fc6
 - Imported translations from Fedora i18n repository
 - Make (most) scrollbar policies automatic




More information about the fedora-cvs-commits mailing list