equal
deleted
inserted
replaced
21 # You should have received a copy of the GNU General Public License |
21 # You should have received a copy of the GNU General Public License |
22 # along with this program; if not, write to the Free Software |
22 # along with this program; if not, write to the Free Software |
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
24 |
24 |
25 |
25 |
26 from __future__ import absolute_import |
26 |
27 from __future__ import print_function |
27 |
28 import traceback |
28 import traceback |
29 from time import sleep |
29 from time import sleep |
30 import copy |
30 import copy |
31 import socket |
31 import socket |
32 import os.path |
32 import os.path |
37 from Pyro.errors import PyroError |
37 from Pyro.errors import PyroError |
38 |
38 |
39 import PSKManagement as PSK |
39 import PSKManagement as PSK |
40 from connectors.PYRO.PSK_Adapter import setupPSKAdapter |
40 from connectors.PYRO.PSK_Adapter import setupPSKAdapter |
41 from runtime import PlcStatus |
41 from runtime import PlcStatus |
|
42 import importlib |
42 |
43 |
43 |
44 |
44 def switch_pyro_adapter(use_ssl): |
45 def switch_pyro_adapter(use_ssl): |
45 """ |
46 """ |
46 Reloads Pyro module with new settings. |
47 Reloads Pyro module with new settings. |
47 This is workaround for Pyro, because it doesn't work with SSL wrapper. |
48 This is workaround for Pyro, because it doesn't work with SSL wrapper. |
48 """ |
49 """ |
49 # Pyro.config.PYRO_BROKEN_MSGWAITALL = use_ssl |
50 # Pyro.config.PYRO_BROKEN_MSGWAITALL = use_ssl |
50 reload(Pyro.protocol) |
51 importlib.reload(Pyro.protocol) |
51 if use_ssl: |
52 if use_ssl: |
52 setupPSKAdapter() |
53 setupPSKAdapter() |
53 |
54 |
54 |
55 |
55 def PYRO_connector_factory(uri, confnodesroot): |
56 def PYRO_connector_factory(uri, confnodesroot): |