connectors/PYRO/__init__.py
changeset 2334 d1470c052662
parent 2324 1cf3768ebf85
child 2338 2c3222433244
--- a/connectors/PYRO/__init__.py	Fri Nov 09 13:26:06 2018 +0100
+++ b/connectors/PYRO/__init__.py	Wed Nov 14 11:32:08 2018 +0100
@@ -126,7 +126,10 @@
 
     if servicetype != "PYROS":
         ID,PSK = IDPSK
-        secpath = os.path.join(str(confnodesroot.ProjectPath), 'psk', ID+'.secret')
+        secdir = os.path.join(str(confnodesroot.ProjectPath), 'psk')
+        if not os.path.exists(secdir):
+            os.mkdir(secdir)
+        secpath = os.path.join(secdir, ID+'.secret')
         with open(secpath, 'w') as f:
             f.write(ID+":"+PSK)