rpms/smolt/devel smolt.py.patch,NONE,1.1 smolt.spec,1.55,1.56

Mike McGrath mmcgrath at fedoraproject.org
Wed Nov 12 21:27:55 UTC 2008


Author: mmcgrath

Update of /cvs/pkgs/rpms/smolt/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5135

Modified Files:
	smolt.spec 
Added Files:
	smolt.py.patch 
Log Message:
updated for bug 470829

smolt.py.patch:

--- NEW FILE smolt.py.patch ---
--- client/smolt.py.orig	2008-11-12 14:57:28.000000000 -0600
+++ client/smolt.py	2008-11-12 14:57:41.000000000 -0600
@@ -312,6 +312,18 @@
     if DEBUG:
         print message
 
+def reset_resolver():
+    '''Attempt to reset the system hostname resolver.
+    returns 0 on success, or -1 if an error occurs.'''
+    import ctypes
+    try:
+        resolv = ctypes.CDLL("libresolv.so.2")
+        r = resolv.__res_init()
+    except (OSError, AttributeError):
+        print "Warning: could not find __res_init in libresolv.so.2"
+        r = -1
+    return r
+ 
 class SystemBusError(Exception):
     def __init__(self, message, hint = None):
         self.message = message
@@ -413,15 +425,17 @@
     
     def get_sendable_fss(self, protocol_version=smoltProtocol):
         return [fs.to_dict() for fs in self.fss]
-     
+
+    
     def send(self, user_agent=user_agent, smoonURL=smoonURL, timeout=timeout):
+        reset_resolver()
         grabber = urlgrabber.grabber.URLGrabber(user_agent=user_agent, timeout=timeout)
         #first find out the server desired protocol
         try:
             token = grabber.urlopen(urljoin(smoonURL + "/", '/tokens/token_json?uuid=%s' % self.host.UUID, False))
         except urlgrabber.grabber.URLGrabError, e:
             error(_('Error contacting Server: %s') % e)
-            return 1
+            return (1, None, None)
         tok_str = token.read()
         try:
             try:
@@ -430,7 +444,7 @@
                     prefered_protocol = tok_obj['prefered_protocol']
                 else: 
                     error(_('Wrong version, server incapable of handling your client'))
-                    return 1
+                    return (1, None, None)
                 tok = tok_obj['token']
 
             except ValueError, e:
@@ -463,7 +477,7 @@
                             ('Content-type', 'application/x-www-form-urlencoded')))
         except urlgrabber.grabber.URLGrabError, e:
             error(_('Error contacting Server: %s') % e)
-            return 1
+            return (1, None, None)
         else:
             pub_uuid = serverMessage(o.read())
             o.close()


Index: smolt.spec
===================================================================
RCS file: /cvs/pkgs/rpms/smolt/devel/smolt.spec,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- smolt.spec	11 Nov 2008 18:46:13 -0000	1.55
+++ smolt.spec	12 Nov 2008 21:27:52 -0000	1.56
@@ -1,12 +1,13 @@
 Name: smolt
 Summary: Fedora hardware profiler
 Version: 1.1.1.1
-Release: 8%{?dist}
+Release: 9%{?dist}
 License: GPLv2+
 Group: Applications/Internet
 URL: http://hosted.fedoraproject.org/projects/smolt
 Source: https://fedorahosted.org/releases/s/m/%{name}/%{name}-%{version}.tar.gz
 Patch0: scan.patch
+Patch1: smolt.py.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch: noarch
@@ -67,6 +68,7 @@
 %prep
 %setup -q
 %patch0 -p0
+%patch1 -p0
 
 %build
 cd client/
@@ -177,6 +179,9 @@
 %{_bindir}/smoltGui
 
 %changelog
+* Wed Nov 12 2008 Mike McGrath <mmcgrath at redhat.com> 1.1.1.1-9
+- Fix for bug 470829
+
 * Tue Nov 11 2008 Mike McGrath <mmcgrath at redhat.com> 1.1.1.1-8
 - Added patch for fixed scanner
 




More information about the fedora-extras-commits mailing list