client/rhel/spacewalk-oscap/scap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit bba72173bd74407120e3c600e33765ea1fda4f47 Author: Simon Lukasik slukasik@redhat.com Date: Thu Jul 25 14:07:02 2013 +0200
Do not try to parse xccdf-report.html with SAX parser
As the SAX parser attempts to download the following files:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
Additionally, if you have had slow DNS server, and PyXML not installed you might have encountered parser failures.
Addressing: [Thu Jul 25 11:51:06 2013] up2date Traceback (most recent call last): File "/usr/share/rhn/actions/scap.py", line 163, in _assert_xml xml.sax.parse(f, xml.sax.ContentHandler()) File "/usr/lib64/python2.6/xml/sax/__init__.py", line 33, in parse parser.parse(source) File "/usr/lib64/python2.6/xml/sax/expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib64/python2.6/xml/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib64/python2.6/xml/sax/expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "/usr/lib64/python2.6/xml/sax/expatreader.py", line 381, in external_entity_ref "") File "/usr/lib64/python2.6/xml/sax/saxutils.py", line 298, in prepare_input_source f = urllib.urlopen(source.getSystemId()) File "/usr/lib64/python2.6/urllib.py", line 86, in urlopen return opener.open(url) File "/usr/lib64/python2.6/urllib.py", line 207, in open return getattr(self, name)(url) File "/usr/lib64/python2.6/urllib.py", line 346, in open_http h.endheaders() File "/usr/lib64/python2.6/httplib.py", line 908, in endheaders self._send_output() File "/usr/lib64/python2.6/httplib.py", line 780, in _send_output self.send(msg) File "/usr/lib64/python2.6/httplib.py", line 739, in send self.connect() File "/usr/lib64/python2.6/httplib.py", line 720, in connect self.timeout) File "/usr/lib64/python2.6/socket.py", line 553, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): <type 'exceptions.IOError'>: [Errno socket error] [Errno -2] Name or service not known
diff --git a/client/rhel/spacewalk-oscap/scap.py b/client/rhel/spacewalk-oscap/scap.py index 9891857..c441a2a 100644 --- a/client/rhel/spacewalk-oscap/scap.py +++ b/client/rhel/spacewalk-oscap/scap.py @@ -131,7 +131,7 @@ def _upload_results(xccdf_result, results_dir, args): return errors
def _upload_file(server, systemid, args, path, filename, f): - if not _assert_xml(f): + if filename != 'xccdf-report.html' and not _assert_xml(f): log.log_debug('Excluding "%s" file from upload. Not an XML.', path) return '\nxccdf_eval: File "%s" not uploaded. Not an XML file format.' % filename
spacewalk-commits@lists.fedorahosted.org