Skip to content

Commit 03030da

Browse files
committed
Fallback to /tmp if specified folder is readonly
1 parent 2c292b1 commit 03030da

File tree

1 file changed

+4
-0
lines changed
  • web/client/codechecker_client/cli

1 file changed

+4
-0
lines changed

web/client/codechecker_client/cli/store.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,10 @@ def main(args):
922922
product_name=product_name)
923923

924924
temp_dir_path: str = args.temp_dir if args.temp_dir else args.input[0]
925+
if not os.access(temp_dir_path, os.W_OK):
926+
# Folder not writeable fallback to /tmp/
927+
LOG.debug("'%s' is readonly, falling back to /tmp", temp_dir_path)
928+
temp_dir_path = "/tmp"
925929
try:
926930
temp_dir = tempfile.mkdtemp(suffix="-store", dir=temp_dir_path)
927931
LOG.debug(f"{temp_dir} directory created successfully!")

0 commit comments

Comments
 (0)