mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 08:33:43 +00:00
clean-venv-cache: Fix an exception with unusual deployment dirs.
This commit is contained in:
committed by
Tim Abbott
parent
9bf81b7fa9
commit
48662a79a5
@@ -31,8 +31,14 @@ def get_caches_in_use(threshold_days):
|
|||||||
caches_in_use.add(CURRENT_CACHE)
|
caches_in_use.add(CURRENT_CACHE)
|
||||||
|
|
||||||
for path in setups_to_check:
|
for path in setups_to_check:
|
||||||
for filename in os.listdir(os.path.join(path, "requirements")):
|
reqs_dir = os.path.join(path, "requirements")
|
||||||
requirements_file = os.path.join(path, "requirements", filename)
|
# If the target directory doesn't contain a requirements
|
||||||
|
# directory, skip it to avoid throwing an exception trying to
|
||||||
|
# list its requirements subdirectory.
|
||||||
|
if not os.path.exists(reqs_dir):
|
||||||
|
continue
|
||||||
|
for filename in os.listdir(reqs_dir):
|
||||||
|
requirements_file = os.path.join(reqs_dir, filename)
|
||||||
deps = expand_reqs(requirements_file)
|
deps = expand_reqs(requirements_file)
|
||||||
hash_val = hash_deps(deps)
|
hash_val = hash_deps(deps)
|
||||||
caches_in_use.add(os.path.join(VENV_CACHE_DIR, hash_val))
|
caches_in_use.add(os.path.join(VENV_CACHE_DIR, hash_val))
|
||||||
|
|||||||
Reference in New Issue
Block a user