Skip to content

Commit 1553fe5

Browse files
authored
Merge pull request #111 from DrDaveD/add-back-default-caches-json
Add back looking for /etc/stashcache/caches.json by default
2 parents e62b3bf + 69bcde5 commit 1553fe5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

stashcp/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,15 @@ def main():
845845
get_best_stashcache()
846846
# does not return
847847

848-
if 'CACHES_JSON' in os.environ:
848+
if args.caches_json:
849+
caches_json_location = args.caches_json
850+
elif 'CACHES_JSON' in os.environ:
849851
caches_json_location = os.environ['CACHES_JSON']
850852
else:
851-
caches_json_location = args.caches_json
853+
prefix = os.environ.get("OSG_LOCATION", "/")
854+
caches_file = os.path.join(prefix, "etc/stashcache/caches.json")
855+
if os.path.exists(caches_file):
856+
caches_json_location = caches_file
852857

853858
cache_list_name = args.cache_list_name
854859
if args.closest or args.list_names:

0 commit comments

Comments
 (0)