Code review comment for lp:~adeuring/launchpad/hwdb-class-udev-device-7

Revision history for this message
Abel Deuring (adeuring) wrote :

This branch has several small improvements for the HWDB submission
processing script for submissions with udev data:

- it fixes a bug in the udev test data for USB storage devices: The udev
  property DEVTYPE was missing.

  This uncovered a (now fixed) bug in BaseDevice.translateScsiBus()
  Up to now, the detection of a USB storage device pretending to be a
  SCSI device was based on the value "usb" of the property raw_bus of an
  ancestor node of the fake SCSI device, but the real value of
  ancestor.raw_bus for udev submissions is "usb_interface". Since this
  value is not used in submissions with HAL data, there are no bad
  side-effects.

- it defines a new property BaseDevice.is_root_device, implemented in
  the derived classes HALDevice and UdevDevice. There are a few places
  in the code, were the root device needs to be treated specially. Up to
  now, the decision "is this device the root device" was based on a
  comparison of the HAL-specific property "udi".

- it modifies the property BaseDevice.real_bus to properly deal with
  udev submissions. If we have a SCSI device, is now detected by
  comparing the value self.raw_bus with 'scsi' and 'scsi_device'. Again,
  HAL does not use the new value 'scsi_device', so there are no bad side
  effects.

- it adds tests for UdevDevice.real_bus and UdevDevice.translatePciBus()

test: ./bin/test --test=test_hwdb_submission_processing

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/canonical/launchpad/scripts/hwdbsubmissions.py
  lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py

== Pyflakes notices ==

lib/canonical/launchpad/scripts/hwdbsubmissions.py
    22: redefinition of unused 'etree' from line 20

== Pylint notices ==

lib/canonical/launchpad/scripts/hwdbsubmissions.py
    20: [F0401] Unable to import 'xml.etree.cElementTree' (No module
named etree)

The complaint is not related to my changes.

« Back to merge proposal