--- a/connectors/ConnectorBase.py Wed Mar 13 14:14:31 2019 +0300
+++ b/connectors/ConnectorBase.py Wed Mar 13 14:27:24 2019 +0300
@@ -22,4 +22,3 @@
return blobID
blobID = self.AppendChunkToBlob(chunk, blobID)
s.update(chunk)
-
--- a/runtime/Stunnel.py Wed Mar 13 14:14:31 2019 +0300
+++ b/runtime/Stunnel.py Wed Mar 13 14:27:24 2019 +0300
@@ -1,4 +1,5 @@
from __future__ import absolute_import
+from __future__ import print_function
import os
from binascii import b2a_hqx
try:
@@ -11,6 +12,17 @@
_PSKpath = None
+def restartStunnel():
+ """
+ Restart stunnel service using SysV init stript
+ to apply new generated credentials
+ """
+ try:
+ call(restart_stunnel_cmdline)
+ except OSError:
+ print(_("Couldn't restart stunnel service"))
+
+
def PSKgen(ID, PSKpath):
# b2a_hqx output len is 4/3 input len
@@ -20,7 +32,7 @@
PSKstring = ID+":"+secretstring
with open(PSKpath, 'w') as f:
f.write(PSKstring)
- call(restart_stunnel_cmdline)
+ restartStunnel()
def ensurePSK(ID, PSKpath):