provision: Use UUID in path to compilemessages hash.

This commit is contained in:
Tim Abbott 2017-10-17 19:17:14 -07:00
parent 2ae2a94444
commit a7c639cff7
1 changed files with 4 additions and 3 deletions

View File

@ -355,13 +355,14 @@ def main(options):
with open(path, 'r') as file_to_hash: with open(path, 'r') as file_to_hash:
sha1sum.update(force_bytes(file_to_hash.read())) sha1sum.update(force_bytes(file_to_hash.read()))
compilemessages_hash_path = os.path.join(UUID_VAR_PATH, "last_compilemessages_hash")
new_compilemessages_hash = sha1sum.hexdigest() new_compilemessages_hash = sha1sum.hexdigest()
run(['touch', 'var/last_compilemessages_hash']) run(['touch', compilemessages_hash_path])
with open('var/last_compilemessages_hash', 'r') as hash_file: with open(compilemessages_hash_path, 'r') as hash_file:
last_compilemessages_hash = hash_file.read() last_compilemessages_hash = hash_file.read()
if options.is_force or (new_compilemessages_hash != last_compilemessages_hash): if options.is_force or (new_compilemessages_hash != last_compilemessages_hash):
with open('var/last_compilemessages_hash', 'w') as hash_file: with open(compilemessages_hash_path, 'w') as hash_file:
hash_file.write(new_compilemessages_hash) hash_file.write(new_compilemessages_hash)
run(["./manage.py", "compilemessages"]) run(["./manage.py", "compilemessages"])
else: else: