Skip to content

Commit

Permalink
Removes directory check condition
Browse files Browse the repository at this point in the history
Since it keeps the directory is directly mounted in the
containers, removing the check should always execute the chmod and
setfacl in the workdir directory.

Signed-off-by: mcasquer <[email protected]>
  • Loading branch information
mcasquer committed Jan 29, 2025
1 parent 7d993c7 commit 605c935
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tmt/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2000,14 +2000,13 @@ def _workdir_init(self, id_: WorkdirArgumentType = None) -> None:

def _check_or_create_workdir_root_with_perms() -> None:
""" If created workdir_root has to be 1777 for multi-user"""
if not self.workdir_root.is_dir():
try:
self.workdir_root.mkdir(exist_ok=True, parents=True)
self.workdir_root.chmod(0o1777)
command = Command('setfacl', '-d', '-m', 'o:rwX', str(self.workdir_root))
self.run(command)
except OSError as error:
raise FileError(f"Failed to prepare workdir '{self.workdir_root}': {error}")
try:
self.workdir_root.mkdir(exist_ok=True, parents=True)
self.workdir_root.chmod(0o1777)
command = Command('setfacl', '-d', '-m', 'o:rwX', str(self.workdir_root))
self.run(command)
except OSError as error:
raise FileError(f"Failed to prepare workdir '{self.workdir_root}': {error}")

if id_ is None:
# Prepare workdir_root first
Expand Down

0 comments on commit 605c935

Please sign in to comment.