scm: Workaround incorrect permissions on created directory

We have seen the directory created with wrong permissions. Since we
haven't been able to find out why it happens this is a workaround.

JIRA: RHELCMP-142
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2020-04-29 09:51:53 +02:00
parent 9a1b9dd154
commit 9fced77140

View File

@ -425,4 +425,10 @@ def get_dir_from_scm(scm_dict, target_path, compose=None):
with temp_dir(prefix="scm_checkout_") as tmp_dir:
scm.export_dir(scm_repo, scm_dir, scm_branch=scm_branch, target_dir=tmp_dir)
files_copied = copy_all(tmp_dir, target_path)
# Make sure the directory has permissions set to 755. This is a workaround
# for a problem where sometimes the directory will be 700 and it will not
# be accessible via httpd.
os.chmod(target_path, 0o755)
return files_copied