Skip to content

Commit

Permalink
Prevent version *.pyc conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Nov 19, 2012
1 parent 200c243 commit cb12880
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ckan/lib/cli.py
Expand Up @@ -130,6 +130,15 @@ def command(self):
if self.verbose:
print 'Initialising DB: SUCCESS'
elif cmd == 'clean' or cmd == 'drop':

# remove any *.pyc version files to prevent conflicts
v_path = os.path.join(os.path.dirname(__file__),
'..', 'migration', 'versions', '*.pyc')
import glob
filelist = glob.glob(v_path)
for f in filelist:
os.remove(f)

model.repo.clean_db()
search.clear()
if self.verbose:
Expand Down

0 comments on commit cb12880

Please sign in to comment.