From c188616917c2270f72e3c370b2ccce34286dd464 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 8 Aug 2019 04:24:32 -0700 Subject: [PATCH] bugfix for not creating dirs --- strpc/rpc.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/strpc/rpc.py b/strpc/rpc.py index 5038be2..46f87b3 100755 --- a/strpc/rpc.py +++ b/strpc/rpc.py @@ -26,15 +26,21 @@ class STRpcRunnerService(object): self.jobs = [] 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()