Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Commit

Permalink
fixup! util: Don't try to create directories at module import time
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Apr 13, 2017
1 parent 4e6de1f commit 8d9f4db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Atomic/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,12 @@ def write_install_data(cls, new_data):
with file_lock(ATOMIC_INSTALL_JSON):
for x in new_data:
install_data[x] = new_data[x]
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False)
json.dump(install_data, temp_file)
temp_file.close()
if not os.path.exists(ATOMIC_VAR_LIB):
os.makedirs(ATOMIC_VAR_LIB)
shutil.move(temp_file.name, ATOMIC_INSTALL_JSON)
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False)
json.dump(install_data, temp_file)
temp_file.close()
if not os.path.exists(ATOMIC_VAR_LIB):
os.makedirs(ATOMIC_VAR_LIB)
shutil.move(temp_file.name, ATOMIC_INSTALL_JSON)

@classmethod
def get_install_name_by_id(cls, iid, install_data=None):
Expand Down

0 comments on commit 8d9f4db

Please sign in to comment.