lazr.restful needs to be imported on staging/production

Bug #801584 reported by Anthony Lenton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Software Center Agent
Fix Released
Low
Unassigned

Bug Description

For some reason specific to our staging/production environments, you need to import lazr.restful as a first step in any script for it to work. Otherwise it fails with a traceback very similar to this:

{{{
sca@dysprosium:/srv/sc.staging.ubuntu.com/staging/code/framework$ python migrate-departments.py
Traceback (most recent call last):
  File "migrate-departments.py", line 14, in <module>
    from softwarecenteragent.models import Department, Application
  File "/usr/lib/python2.6/dist-packages/softwarecenteragent/models/__init__.py", line 1, in <module>
    from .webservice import (
  File "/usr/lib/python2.6/dist-packages/softwarecenteragent/models/webservice.py", line 25, in <module>
    from softwarecenteragent.subscription_states import (
  File "/usr/lib/python2.6/dist-packages/softwarecenteragent/subscription_states.py", line 14, in <module>
    from softwarecenteragent.utilities import (
  File "/usr/lib/python2.6/dist-packages/softwarecenteragent/utilities.py", line 13, in <module>
    from launchpadlib.launchpad import Launchpad
  File "/usr/lib/pymodules/python2.6/launchpadlib/launchpad.py", line 28, in <module>
    from lazr.uri import URI
ImportError: No module named uri
}}}

That is, it fails to find lazr.uri. Funnily, importing lazr.restful at the top of the script you're attempting to run fixes this issue.

Changed in software-center-agent:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Dave Morley (davmor2) wrote :

This may go away with the precise upgrade. This will need reviewing again then.

Changed in software-center-agent:
status: Confirmed → Triaged
Revision history for this message
Tong Shinn (tshinn) wrote :

This has most likely been resolved, based on the following observations:
- subscription_states.py no longer imports from softwarecenteragent.utilities
- softwarecenteragent.utilities no longer exists and cannot be imported
- launchpadlib.launchpad no longer exists and cannot be imported

Changed in software-center-agent:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.