This branch makes the method l.c.l.scripts.hwsdbsubmissions.SubmissionParser._parseSummary() aware of the new optional node <kernel-release> in HWDB submissions. Data submitted by the HWDB client in Karmic will contain this data.
test: ./bin/test-t test_hwdb_submission_parser
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
This branch makes the method l.c.l.scripts. hwsdbsubmission s.SubmissionPar ser._parseSumma ry() aware of the new optional node <kernel-release> in HWDB submissions. Data submitted by the HWDB client in Karmic will contain this data.
test: ./bin/test-t test_hwdb_ submission_ parser
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: /launchpad/ scripts/ hwdbsubmissions .py /launchpad/ scripts/ tests/test_ hwdb_submission _parser. py
lib/canonical
lib/canonical
== Pyflakes notices ==
lib/canonical/ launchpad/ scripts/ hwdbsubmissions .py
22: redefinition of unused 'etree' from line 20
lib/canonical/ launchpad/ scripts/ tests/test_ hwdb_submission _parser. py
10: redefinition of unused 'etree' from line 8
== Pylint notices ==
lib/canonical/ launchpad/ scripts/ hwdbsubmissions .py cElementTree' (No module named etree)
20: [F0401] Unable to import 'xml.etree.
This message is not related to my changes.
This branch is based on lp:~adeuring/launchpad/bug-438169-parse-sysfs-attr, reviewed by gmb, but not yet landed. The diff against this branch:
=== modified file 'lib/canonical/ launchpad/ scripts/ hwdbsubmissions .py' launchpad/ scripts/ hwdbsubmissions .py 2009-09-29 10:11:50 +0000 launchpad/ scripts/ hwdbsubmissions .py 2009-09-29 15:02:47 +0000
'contactable' : _getValueAttrib uteAsBoolean,
'date_ created' : _getValueAttrib uteAsDateTime, uteAsString,
--- lib/canonical/
+++ lib/canonical/
@@ -260,6 +260,7 @@
'client': _getClientData,
+ 'kernel-release': _getValueAttrib
}
def _parseSummary(self, summary_node):
=== modified file 'lib/canonical/ launchpad/ scripts/ tests/test_ hwdb_submission _parser. p launchpad/ scripts/ tests/test_ hwdb_submission _parser. py 2009-0 launchpad/ scripts/ tests/test_ hwdb_submission _parser. py 2009-0
summary, expected_data,
' SubmissionParse r.parseSummary returned an unexpected result')
y'
--- lib/canonical/
9-29 11:23:04 +0000
+++ lib/canonical/
9-29 15:03:15 +0000
@@ -209,6 +209,58 @@
+ def testSummaryNode WithKernelRelea se(self) : release> .""" g(""" f982bb1ab536469 cebfd6eaadcea0f fc"/> 2007-09- 28T16:09: 20.126842" /> ure_info" version="1.1"/> network_ controllers" version="2.34"/> 2.6.28- 15-generic" /> r(self. log) _parseSummary( node) 'UTC') 9cebfd6eaadcea0 ffc', info', controllers' , 15-generic' , er.parseSummary returned an unexpected result') t(self, xml): r(self. log) g(xml)
+ """The <smmary> node may contain the sub-node <kernel-
+ node = etree.fromstrin
+ <summary>
+ <live_cd value="False"/>
+ <system_id value="
+ <distribution value="Ubuntu"/>
+ <distroseries value="7.04"/>
+ <architecture value="amd64"/>
+ <private value="False"/>
+ <contactable value="False"/>
+ <date_created value="
+ <client name="hwtest" version="0.9">
+ <plugin name="architect
+ <plugin name="find_
+ </client>
+ <kernel-release value="
+ </summary>
+ """)
+ parser = SubmissionParse
+ summary = parser.
+ utc_tz = pytz.timezone(
+ expected_data = {
+ 'live_cd': False,
+ 'system_id': 'f982bb1ab53646
+ 'distribution': 'Ubuntu',
+ 'distroseries': '7.04',
+ 'architecture': 'amd64',
+ 'private': False,
+ 'contactable': False,
+ 'date_created': datetime(2007, 9, 28, 16, 9, 20, 126842,
+ tzinfo=utc_tz),
+ 'client': {
+ 'name': 'hwtest',
+ 'version': '0.9',
+ 'plugins': [
+ {
+ 'name': 'architecture_
+ 'version': '1.1'
+ },
+ {
+ 'name': 'find_network_
+ 'version': '2.34'
+ }
+ ]
+ },
+ 'kernel-release': '2.6.28-
+ }
+ self.assertEqual(
+ summary, expected_data,
+ 'SubmissionPars
+
def _runPropertyTes
parser = SubmissionParse
node = etree.fromstrin