NameError sometimes in Ubuntu One replication

Bug #655267 reported by Chad Miller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
desktopcouch
Fix Released
High
Chad Miller

Bug Description

In 0.6.9b, it is possible for replication_services.ubuntuone.PrefixGetter to get in a state where it will not replicate. On first run of the __str__ method, self.oauth_header is None, so we get oauth data and create a local "consumer" variable.

Then, we use that consumer variable to construct an oauth header.

We then try to get the "couchdb_root" from U1 API. IF that succeeds, then we save the result and on future runs we give that out. If that fails, we start over at the previous step, using a nonexistent consumer variable to construct an oauth header.

Using a nonexistent variable causes UnboundLocalError.

DEBUG:replication:Looking up prefix for service 'ubuntuone'
DEBUG:replication:Looking up prefix for service 'ubuntuone'
ERROR:replication:replication of services aborted
Traceback (most recent call last):
  File "/home/cmiller/work/canonical/desktopcouch/trunk/desktopcouch/replication.py", line 145, in do_all_replication
    remote_location = str(prefix_getter)
  File "/home/cmiller/work/canonical/desktopcouch/trunk/desktopcouch/replication_services/ubuntuone.py", line 88, in __str__
    consumer, access_token, url)
UnboundLocalError: local variable 'consumer' referenced before assignment
replication 2010-10-05 12:57:08,681 - replication of services aborted

Related branches

Chad Miller (cmiller)
Changed in desktopcouch:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Chad Miller (cmiller)
dobey (dobey)
Changed in desktopcouch:
status: Confirmed → Fix Committed
Chad Miller (cmiller)
Changed in desktopcouch:
status: Fix Committed → 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.