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 850025 Details for
Bug 1052321
traceback on empty results.xml file
[?]
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]
exception-handling patch for parse errors
0001-1022749-traceback-on-empty-results.xml-file.patch (text/plain), 3.54 KB, created by
Greg Nichols
on 2014-01-14 16:19:53 UTC
(
hide
)
Description:
exception-handling patch for parse errors
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2014-01-14 16:19:53 UTC
Size:
3.54 KB
patch
obsolete
>From e0496c948d251b2df29846010372ffaeaf93893d Mon Sep 17 00:00:00 2001 >From: Dong Zhu <dzhu@redhat.com> >Date: Wed, 11 Dec 2013 10:15:29 +0800 >Subject: [PATCH 1/2] 1022749 - traceback on empty results.xml file > >Signed-off-by: Dong Zhu <dzhu@redhat.com> >--- > hwcert/certificationtest.py | 19 +++++++++++-------- > hwcert/documentbase.py | 10 +++++++--- > hwcert/harness.py | 5 +++-- > 3 files changed, 21 insertions(+), 13 deletions(-) > >diff --git a/hwcert/certificationtest.py b/hwcert/certificationtest.py >index a5fbfdb..85a48b5 100644 >--- a/hwcert/certificationtest.py >+++ b/hwcert/certificationtest.py >@@ -181,14 +181,17 @@ class ResultsDocument(CertificationDocument): > > def load(self, filename): > DocumentBase.load(self, filename) >- self.deviceClasses = dict() >- deviceClassElements = list() >- for element in self.document.documentElement.childNodes: >- if element.nodeName == Tags.device_class: >- deviceClassElements.append(element) >- for deviceClassElement in deviceClassElements: >- deviceClass = deviceclassdocument.GetDeviceClass(deviceClassElement, self.document) >- self.deviceClasses[deviceClass.getName()] = deviceClass >+ if self.document: >+ self.deviceClasses = dict() >+ deviceClassElements = list() >+ for element in self.document.documentElement.childNodes: >+ if element.nodeName == Tags.device_class: >+ deviceClassElements.append(element) >+ for deviceClassElement in deviceClassElements: >+ deviceClass = deviceclassdocument.GetDeviceClass(deviceClassElement, self.document) >+ self.deviceClasses[deviceClass.getName()] = deviceClass >+ return True >+ return False > > def importElement(self, topElement): > DocumentBase.importElement(self, topElement) >diff --git a/hwcert/documentbase.py b/hwcert/documentbase.py >index f28bd56..8ef1dc2 100644 >--- a/hwcert/documentbase.py >+++ b/hwcert/documentbase.py >@@ -264,16 +264,20 @@ class DocumentBase(DocumentWrapper): > if filename[-2:] == "gz": > file = gzip.open(filename, 'rb') > self.loadedFileSize = os.path.getsize(self.loadedFilePath) >- self.document = parse(file) >- file.close() > else: > try: > self.loadedFileSize = os.path.getsize(self.loadedFilePath) # bytes > except OSError: > pass > file = open(filename, "r") >+ try: > self.document = parse(file) >- file.close() >+ except Exception, e: >+ print "Error: could not parse %s" % filename >+ print e >+ self.document = None >+ >+ file.close() > > def save(self, filename): > file = open(filename, "w") >diff --git a/hwcert/harness.py b/hwcert/harness.py >index 313b642..ccc3cc4 100644 >--- a/hwcert/harness.py >+++ b/hwcert/harness.py >@@ -55,10 +55,11 @@ class HardwareTestHarness(Controller): > def load(self): > try: > self.certification = ResultsDocument(self.options.debug != Constants.off) >- self.certification.load(self.environment.getResultsPath()) >+ if not self.certification.load(self.environment.getResultsPath()): >+ self.certification = None > except IOError: > self.certification = None >- return >+ return > > def doDiscover(self): > self.certification = ResultsDocument(self.options.debug != Constants.off) >-- >1.8.4.2 >
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 1052321
: 850025 |
850027