]> code.delx.au - pymsnt/blobdiff - src/housekeep.py
Fixed md5 update routine to work if spooldir is not set.
[pymsnt] / src / housekeep.py
index eff8ab644d17ea3ee5f1a929c1a9984c41bcf395..82a459bdd46ebff23deb0dca16f7e73d61b6bc7e 100644 (file)
@@ -133,8 +133,8 @@ def doMD5HashDirUpgrade():
        if os.path.exists(pre + "avatars"):
                # Remove the avatars dir that gets created when we import
                # legacy/glue.py (it only contains the defaultAvatar)
-               shutil.rmtree(config.spooldir + X + "avatars")
-               shutil.move(pre + "avatars", config.spooldir + X + "avatars")
+               shutil.rmtree(os.path.join(config.spooldir, "avatars"))
+               shutil.move(pre + "avatars", os.path.join(config.spooldir, "avatars"))
        else:
                print "Could not move your cached avatars directory automatically. It is safe to delete it, the avatars will be recreated as necessary."
 
@@ -155,7 +155,7 @@ def doMD5HashDirUpgrade():
                                if not os.path.exists(pre + hash):
                                        os.makedirs(pre + hash)
                                shutil.move(pre2 + file, pre + hash + X + file)
-                       os.rmdir(pre)
+                       os.rmdir(pre2)
        except Exception, e:
                print "Error in migration", pre, dir, hash, file, str(e)
                sys.exit(1)