OPC-UA: tolerate better pre-encryption formated client configuration file.
--- a/opc_ua/client.py Tue Nov 15 20:43:39 2022 +0100
+++ b/opc_ua/client.py Fri Nov 18 07:34:29 2022 +0100
@@ -101,7 +101,13 @@
return self.modeldata
def GetConfig(self):
- cfg = lambda path: self.GetParamsAttributes("OPCUAClient."+path)["value"]
+ def cfg(path):
+ try:
+ attr=self.GetParamsAttributes("OPCUAClient."+path)
+ except ValueError:
+ return None
+ return attr["value"]
+
AuthType = cfg("AuthType")
res = dict(URI=cfg("Server_URI"), AuthType=AuthType)
--- a/tests/projects/opcua_client/opcua_0@opcua/confnode.xml Tue Nov 15 20:43:39 2022 +0100
+++ b/tests/projects/opcua_client/opcua_0@opcua/confnode.xml Fri Nov 18 07:34:29 2022 +0100
@@ -1,4 +1,2 @@
<?xml version='1.0' encoding='utf-8'?>
-<OPCUAClient xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <AuthType/>
-</OPCUAClient>
+<OPCUAClient xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>