Bail with an error on a non-existent jobroot_dir
If the user gives a config location that does not exist, raise an error. We don't do makedirs calls later - and depending on the location it wouldn't necessarily be appropriate to. Change-Id: If4ab428682d2130a0b0f1cc63e57f9aa51b7e241
This commit is contained in:
parent
08ec3bade9
commit
50e6b6b0b5
@ -121,6 +121,10 @@ class Executor(zuul.cmd.ZuulApp):
|
|||||||
if self.config.has_option('zuul', 'jobroot_dir'):
|
if self.config.has_option('zuul', 'jobroot_dir'):
|
||||||
self.jobroot_dir = os.path.expanduser(
|
self.jobroot_dir = os.path.expanduser(
|
||||||
self.config.get('zuul', 'jobroot_dir'))
|
self.config.get('zuul', 'jobroot_dir'))
|
||||||
|
if not os.path.isdir(self.jobroot_dir):
|
||||||
|
print("Invalid jobroot_dir: {jobroot_dir}".format(
|
||||||
|
jobroot_dir=self.jobroot_dir))
|
||||||
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
self.jobroot_dir = tempfile.gettempdir()
|
self.jobroot_dir = tempfile.gettempdir()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user