Skip to content

Commit 0052a66

Browse files
authored
fix(bsd): correct the _ROOT_TMPDIR path for *BSD system (#6794)
fix(bsd): correct the _ROOT_TMPDIR path for *BSD system (solves #5789) Fixes GH-5789
1 parent 724e085 commit 0052a66

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cloudinit/temp_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ def get_tmp_ancestor(odir=None, needs_exe: bool = False):
2020
if needs_exe:
2121
return _EXE_ROOT_TMPDIR
2222
if os.getuid() == 0:
23-
return _ROOT_TMPDIR
23+
if util.is_BSD():
24+
return "/var/" + _ROOT_TMPDIR
25+
else:
26+
return _ROOT_TMPDIR
2427
return os.environ.get("TMPDIR", "/tmp")
2528

2629

0 commit comments

Comments
 (0)