bugfix for not creating dirs

This commit is contained in:
Jeffrey Paul 2019-08-08 04:24:32 -07:00
parent 958109a90b
commit c188616917

View File

@ -27,14 +27,20 @@ class STRpcRunnerService(object):
self.running = True
self.dockerpath = None
log.info("strpcd starting up on %s" % self.hostname)
log.info("strpcd starting up on %s out of directory %s" % (
self.hostname, self.dir)
)
if not os.path.isdir(self.dir):
raise Exception("STRPC base directory not found")
self.setup()
def setup(self):
log.info("creating dir %s if not exist" % self.hostdir)
pathlib.Path(self.hostdir).mkdir(parents=True, exist_ok=True)
log.info("creating dir %s if not exist" % self.jobdir)
pathlib.Path(self.jobdir).mkdir(parents=True, exist_ok=True)
log.info("creating dir %s if not exist" % self.logdir)
pathlib.Path(self.logdir).mkdir(parents=True, exist_ok=True)
self.write_status_file()