Closed Bug 871803 Opened 11 years ago Closed 11 years ago

typo in mozprofile addons.py

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: k0scist, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

From https://bugzilla.mozilla.org/show_bug.cgi?id=841086#c22

(mozmill)│mozprofile -a
/home/jhammel/mozmill/src/mozbase/mozprofile/tests/addons/empty.xpi
/tmp/tmpgJsvbt.mozrunner
(mozmill)│ls /tmp/tmpgJsvbt.mozrunner
extensions  prefs.js  user.js
(mozmill)│ls /tmp/tmpgJsvbt.mozrunner/extensions/
staged
(mozmill)│ls /tmp/tmpgJsvbt.mozrunner/extensions/staged/
test-empty@quality.mozilla.org.xpi
(mozmill)│mozprofile -p /tmp/tmpgJsvbt.mozrunner -a
/home/jhammel/mozmill/src/mozbase/mozprofile/tests/addons/empty.xpi
Exception UnboundLocalError: "local variable 'addon' referenced before
assignment" in <bound method AddonManager.clean_addons of
<mozprofile.addons.AddonManager object at 0xa4c72ac>> ignored

Reduced test case:

(mozmill)│mozprofile -a
/home/jhammel/mozmill/src/mozbase/mozprofile/tests/addons/empty.xpi -p
$(mozprofile -a
/home/jhammel/mozmill/src/mozbase/mozprofile/tests/addons/empty.xpi)
Exception UnboundLocalError: "local variable 'addon' referenced before
assignment" in <bound method AddonManager.clean_addons of
<mozprofile.addons.AddonManager object at 0xa6b02cc>> ignored

And this is why we have tests, ladies and gentlemen:

diff --git a/mozprofile/mozprofile/addons.py
b/mozprofile/mozprofile/addons.py
index dcd5df3..8dbdf3c 100644
--- a/mozprofile/mozprofile/addons.py
+++ b/mozprofile/mozprofile/addons.py
@@ -257,7 +257,7 @@ class AddonManager(object):
             extensions_path = os.path.join(self.profile,
             'extensions', 'staged')
             for backup in os.listdir(self.backup_dir):
                 backup_path = os.path.join(self.backup_dir, backup)
-                addon_path = os.path.join(extensions_path, addon)
+                addon_path = os.path.join(extensions_path, backup)
                 shutil.move(backup_path, addon_path)
             if not os.listdir(self.backup_dir):
                 shutil.rmtree(self.backup_dir, ignore_errors=True)
Blocks: 841086
Attached patch fixSplinter Review
Attachment #749037 - Flags: review?(wlachance)
Comment on attachment 749037 [details] [diff] [review]
fix

lgtm
Attachment #749037 - Flags: review?(wlachance) → review+
Regression from bug 759594.
Blocks: 759594
Keywords: regression
pushed: https://github.com/mozilla/mozbase/commit/e04ac670b3e75e3da43a9884c464d0f7ca8e6116
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: