dont fail if old module does not exist

This commit is contained in:
j 2015-03-14 17:44:08 +05:30
parent fe6f81505b
commit d933ca8f63

View file

@ -114,9 +114,12 @@ def install():
tar.extractall()
tar.close()
os.chdir(os.path.dirname(settings.base_dir))
shutil.move(module, '%s_old' % module)
module_old = '%s_old' % module
if os.path.exists(module):
shutil.move(module, module_old)
shutil.move(os.path.join(new, module), module)
shutil.rmtree('%s_old' % module)
if os.path.exists(module_old):
shutil.rmtree(module_old)
shutil.rmtree(new)
else:
os.unlink(module_tar)