rpms/system-config-printer/F-8 system-config-printer-reconnect.patch, NONE, 1.1 system-config-printer.spec, 1.153, 1.154

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Fri Jan 18 12:07:18 UTC 2008


Author: twaugh

Update of /cvs/pkgs/rpms/system-config-printer/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12063

Modified Files:
	system-config-printer.spec 
Added Files:
	system-config-printer-reconnect.patch 
Log Message:
* Fri Jan 18 2008 Tim Waugh <twaugh at redhat.com> 0.7.74.9-2
- Applied patch from upstream to use a better reconnection method, to avoid
  'Local authentication certificate not found' messages.


system-config-printer-reconnect.patch:

--- NEW FILE system-config-printer-reconnect.patch ---
diff -U0 system-config-printer-0.7.74.9/ChangeLog.reconnect system-config-printer-0.7.74.9/ChangeLog
--- system-config-printer-0.7.74.9/ChangeLog.reconnect	2008-01-16 17:25:26.000000000 +0000
+++ system-config-printer-0.7.74.9/ChangeLog	2008-01-18 11:55:40.000000000 +0000
@@ -0,0 +1,7 @@
+2008-01-18  Tim Waugh  <twaugh at redhat.com>
+
+	* system-config-printer.py (GUI.reconnect): Better reconnection
+	method.
+	(GUI.save_serversettings): Really refresh server settings after
+	applying changes.
+
diff -up system-config-printer-0.7.74.9/system-config-printer.py.reconnect system-config-printer-0.7.74.9/system-config-printer.py
--- system-config-printer-0.7.74.9/system-config-printer.py.reconnect	2008-01-16 17:25:26.000000000 +0000
+++ system-config-printer-0.7.74.9/system-config-printer.py	2008-01-18 11:55:40.000000000 +0000
@@ -915,17 +915,30 @@ class GUI:
 
     def reconnect (self):
         """Reconnect to CUPS after the server has reloaded."""
-        # libcups will handle the reconnection; we just need to tell it
-        # to do something.
-        try:
-            self.cups.getClasses ()
-        except cups.IPPError, (e, s):
-            self.show_IPP_Error(e, s)
-        except cups.HTTPError, (s,):
-            self.cups = None
-            self.setConnected()
-            self.populateList()
-            self.show_HTTP_Error(s)
+        # libcups would handle the reconnection if we just told it to
+        # do something, for example fetching a list of classes.
+        # However, our local authentication certificate would be
+        # invalidated by a server restart, so it is better for us to
+        # handle the reconnection ourselves.
+
+        # Disconnect.
+        self.cups = None
+        self.setConnected()
+
+        cups.setServer(self.connect_server)
+        cups.setUser(self.connect_user)
+        attempt = 1
+        while attempt <= 5:
+            try:
+                self.cups = cups.Connection ()
+                break
+            except RuntimeError:
+                # Connection failed.
+                time.sleep(1)
+                attempt += 1
+
+        self.setConnected()
+        self.passwd_retry = False
 
     def on_btnCancelConnect_clicked(self, widget):
         """Close Connect dialog"""
@@ -2083,7 +2096,7 @@ class GUI:
         # Refresh the server settings in case they have changed in the
         # mean time.
         try:
-            self.server_settings = self.cups.adminGetServerSettings()
+            self.fillServerTab()
         except:
             nonfatalException()
 


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/F-8/system-config-printer.spec,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -r1.153 -r1.154
--- system-config-printer.spec	16 Jan 2008 17:41:56 -0000	1.153
+++ system-config-printer.spec	18 Jan 2008 12:06:28 -0000	1.154
@@ -3,7 +3,7 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 0.7.74.9
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2+
 URL: http://cyberelk.net/tim/software/system-config-printer/
 Group: System Environment/Base
@@ -11,6 +11,7 @@
 Source1: pycups-%{pycups_version}.tar.bz2
 Source2: system-config-printer.pam
 Source3: system-config-printer.console
+Patch0: system-config-printer-reconnect.patch
 
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
@@ -52,6 +53,7 @@
 
 %prep
 %setup -q -a 1
+%patch0 -p1 -b .reconnect
 
 %build
 %configure
@@ -122,6 +124,10 @@
 exit 0
 
 %changelog
+* Fri Jan 18 2008 Tim Waugh <twaugh at redhat.com> 0.7.74.9-2
+- Applied patch from upstream to use a better reconnection method, to avoid
+  'Local authentication certificate not found' messages.
+
 * Wed Jan 16 2008 Tim Waugh <twaugh at redhat.com> 0.7.74.9-1
 - 0.7.74.9:
   - Set data button state when there is no CUPS connection.




More information about the fedora-extras-commits mailing list