From d00a49d68211b9b7a6cbf3476c63b0039b0cb0a5 Mon Sep 17 00:00:00 2001 From: ahrenholz Date: Fri, 25 Oct 2013 15:21:08 +0000 Subject: [PATCH] added mkdir flag to Session.__init__() to allow adopting existing sessions (Boeing r1786) --- daemon/core/session.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/core/session.py b/daemon/core/session.py index edc3a0e9..6ee6f221 100644 --- a/daemon/core/session.py +++ b/daemon/core/session.py @@ -45,7 +45,7 @@ class Session(object): ''' CORE session manager. ''' def __init__(self, sessionid = None, cfg = {}, server = None, - persistent = False): + persistent = False, mkdir = True): if sessionid is None: # try to keep this short since it's used to construct # network interface names @@ -57,7 +57,8 @@ class Session(object): self.sessionid = sessionid self.sessiondir = os.path.join(tempfile.gettempdir(), "pycore.%s" % self.sessionid) - os.mkdir(self.sessiondir) + if mkdir: + os.mkdir(self.sessiondir) self.name = None self.filename = None self.thumbnail = None