From c6f18eb55776da30f83c223caa9973ea5bf9f6f0 Mon Sep 17 00:00:00 2001 From: Sebastian Achilles Date: Mon, 16 Mar 2026 22:07:09 +0100 Subject: [PATCH 1/2] enhance `is_repo_available()` to check if CVMFS repository paths are not empty --- src/eessi/cli/check.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/eessi/cli/check.py b/src/eessi/cli/check.py index 7c296e4..988e50e 100644 --- a/src/eessi/cli/check.py +++ b/src/eessi/cli/check.py @@ -90,7 +90,10 @@ def is_repo_available(repo: str): """ repo_path = os.path.join(CVMFS_ROOT, repo) if os.path.isdir(repo_path): - res = (OK, f"{repo_path} is available") + if os.listdir(repo_path): + res = (OK, f"{repo_path} is available") + else: + res = (ERROR, f"{repo_path} exists but is empty") else: res = (ERROR, f"{repo_path} is NOT available") From b6080ca255aa6bf702d5c1f42b81effa2263a70f Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Mon, 30 Mar 2026 17:32:02 +0200 Subject: [PATCH 2/2] add comment to explain why we also do `listdir` in `is_repo_available` --- src/eessi/cli/check.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/eessi/cli/check.py b/src/eessi/cli/check.py index 988e50e..240722e 100644 --- a/src/eessi/cli/check.py +++ b/src/eessi/cli/check.py @@ -90,6 +90,8 @@ def is_repo_available(repo: str): """ repo_path = os.path.join(CVMFS_ROOT, repo) if os.path.isdir(repo_path): + # also make sure the directory is not empty, + # see also https://github.com/EESSI/eessi-cli/issues/21 if os.listdir(repo_path): res = (OK, f"{repo_path} is available") else: