Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 878464 Details for
Bug 1080458
Application Error: 32000 searching for certification via hwcert-client "hwcert"
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch adding retries for xmlrpm time-outs when searching catalog
0001-1080458-Application-Error-32000-searching-for-certif.patch (text/plain), 5.02 KB, created by
Greg Nichols
on 2014-03-25 13:39:33 UTC
(
hide
)
Description:
patch adding retries for xmlrpm time-outs when searching catalog
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2014-03-25 13:39:33 UTC
Size:
5.02 KB
patch
obsolete
>From e7377f65863cefe70fb84a93726aa68a34084212 Mon Sep 17 00:00:00 2001 >From: Greg Nichols <gnichols@redhat.com> >Date: Tue, 25 Mar 2014 09:37:31 -0400 >Subject: [PATCH] 1080458 - Application Error: 32000 searching for > certification via hwcert-client 'hwcert' > >--- > hwcert/catalog.py | 50 ++++++++++++++++++++++++++++++++++++++++---------- > 1 file changed, 40 insertions(+), 10 deletions(-) > >diff --git a/hwcert/catalog.py b/hwcert/catalog.py >index 8c99fdd..5939985 100644 >--- a/hwcert/catalog.py >+++ b/hwcert/catalog.py >@@ -18,7 +18,7 @@ > # Notes: > # The catalog instance (server URL) is taken from the enviroment (/etc/hwcert.xml). > >-import sys, re, xmlrpclib, urllib2, os, datetime >+import sys, re, xmlrpclib, urllib2, os, datetime, socket > > from hwcert.controller import Controller > from hwcert.environment import Environment >@@ -32,6 +32,9 @@ class Catalog(Controller): > self.environment = environment > self.login = None > self.password = None >+ self.socketDefaultTimeout = socket.getdefaulttimeout() >+ if self.debug != Constants.off: >+ print "Default socket timeout: %s" % self.socketDefaultTimeout > > def getCatalogServer(self): > catalogServer = self.environment.getCatalogURL() >@@ -65,7 +68,7 @@ class Catalog(Controller): > # search for it > id = self.__searchForCertification(resultsDocument) > if id: >- resultsDocument.setCertificationID(answer) >+ resultsDocument.setCertificationID(id) > return True > > # otherwise, open a new one, or enter an id directly >@@ -269,12 +272,20 @@ class Catalog(Controller): > return False # don't retry > > def __search(self, parameters, thing): >- >+ retries = 3 >+ timeout = 10 # seconds >+ sys.stdout.write("Searching...") >+ sys.stdout.flush() >+ id = 0 >+ start = None >+ stop = None > while True: >- if not self.login: >+ if not self.login or not self.password: >+ print "" > self.login = self.ui.prompt("Red Hat Catalog User Name: ") >- if not self.password: > self.password = self.ui.promptPassword("Password: ") >+ sys.stdout.write("Searching...") >+ sys.stdout.flush() > parameters["login"] = self.login > parameters["password"] = self.password > >@@ -287,13 +298,14 @@ class Catalog(Controller): > print " %s:%s" % (key, value) > print "" > >- sys.stdout.write("Searching...") > serverProxy = xmlrpclib.ServerProxy(self.environment.getCatalogURL()) > > try: >+ socket.setdefaulttimeout(timeout) > start = datetime.datetime.now() > ids = serverProxy.Search.simple(parameters) > stop = datetime.datetime.now() >+ socket.setdefaulttimeout(self.socketDefaultTimeout) > if self.debug != Constants.off: > print "Search took %s" % (stop-start) > print "\ndone." >@@ -316,17 +328,35 @@ class Catalog(Controller): > return int(id) > > except xmlrpclib.Fault, error: >- stop = datetime.datetime.now() >- print "Search took %s" % (stop-start) >+ if self.debug != Constants.off: >+ stop = datetime.datetime.now() >+ print "Search took %s" % (stop-start) > print "Error: searching for %s:" % thing > if not self.handleRPCException(error): > return 0 > >+ except socket.timeout: >+ if self.debug != Constants.off: >+ stop = datetime.datetime.now() >+ print "Search timeout at %s" % (stop-start) >+ else: >+ sys.stdout.write(".") >+ sys.stdout.flush() >+ if retries: >+ retries = retries -1 >+ else: >+ print "Error: repeated search timeout" >+ return 0 >+ > except Exception, e: > print "Error: searching for %s:" % thing > print e > return 0 > >+ finally: >+ stop = datetime.datetime.now() >+ socket.setdefaulttimeout(self.socketDefaultTimeout) >+ > def __searchForCertification(self, resultsDocument): > > arch = resultsDocument.getHardware(Tags.arch) >@@ -450,13 +480,13 @@ class Catalog(Controller): > id = 0 > parameters = { > "vendor":"Intel Corporation", >- # "make":"Unknown", >+ "make":"Unknown", > "product":"Hardware Layer", > "model":"S2600CP" > } > while True: > count += 1 >- print "Searching:" >+ "Self-Test Search calling __search:" > id = self.__search(parameters, "specification") > print "Try: %s, id=%s" % (count, id) > >-- >1.8.5.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1080458
: 878464 |
878471