Fix issues enabling extensions containing copy/pasted settings.

Review Request #6054 — Created July 3, 2014 and submitted

Information

Djblets
release-0.8.x
c9e57e2...

Reviewers

When enabling an extension and installing its media, we work with a lock
to ensure that two processes aren't attempting to install media at the
same time. We then remove the lock file. This happens until the old
stored version in settings matches up with the current version of the
extension.

Where this falls apart is if an administrator copy/pastes a settings
dictionary from one server (say, a test server) into a disabled
extension's settings in the database editor, and then tries to enable
it. The versions will match up, but the extension won't be installed
yet, so we'll go through the locking phase. However, since the versions
match, we don't actually create a lock, and then we blow up trying to
remove it.

If the extension's data is not yet installed, its old version (if any)
is not to be trusted. Treat it like a fresh install.

I hit this a little while back when copying/pasting a settings dictionary
from one devserver to another. This fix prevented the problem from
happening.

Unit tests pass. They fail before this fix with the same error I hit before.

Description From Last Updated

local variable 'hook' is assigned to but never used

reviewbotreviewbot

local variable 'hook' is assigned to but never used

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/extensions/manager.py
        djblets/extensions/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/extensions/manager.py
        djblets/extensions/tests.py
    
    
  2. djblets/extensions/tests.py (Diff revision 1)
     
     
    Show all issues
     local variable 'hook' is assigned to but never used
    
  3. djblets/extensions/tests.py (Diff revision 1)
     
     
    Show all issues
     local variable 'hook' is assigned to but never used
    
  4. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.8.x (189edb7)