executor: resolve build root real path
This change fixes bubblewrap roles not found issues when /var/lib/zuul is a symlink by using a realpath resolve on the jobdir root, resulting in a consistent path with the path used for roles location. This issue is happening since job_dir now defaults to /var/lib/zuul and when this directory is a symlink to /srv/zuul: - roles paths in ansible.cfg are resolved and prefixed with /srv/zuul - executor starts bubblewrap --bind /var/lib/zuul/builds/ - job fails with: ERROR! the role 'emit-job-header' was not found in: - /var/lib/zuul/builds/xx/trusted/project_0/config/playbooks/base/roles - /srv/zuul/builds/xx/ansible/pre_playbook_0/role_0/zuul-jobs/roles ... The first path is relative to playbook path, the rest are realpaths that are not available in the bubblewrap. Change-Id: I234b1beb04e1d2510267a4e85682a78c383bd2a4
This commit is contained in:
parent
618be8a063
commit
b57bb86daf
|
@ -375,7 +375,7 @@ class JobDir(object):
|
|||
tmpdir = root
|
||||
else:
|
||||
tmpdir = tempfile.gettempdir()
|
||||
self.root = os.path.join(tmpdir, build_uuid)
|
||||
self.root = os.path.realpath(os.path.join(tmpdir, build_uuid))
|
||||
os.mkdir(self.root, 0o700)
|
||||
self.work_root = os.path.join(self.root, 'work')
|
||||
os.makedirs(self.work_root)
|
||||
|
|
Loading…
Reference in New Issue