# HG changeset patch # User Edouard Tisserant # Date 1668753269 -3600 # Node ID 6c496a8ed2a94d0d1e4bcfd43ca2992cdb6bea64 # Parent 6d9040e07c322746e968e485f9078bef2cc785d8 OPC-UA: tolerate better pre-encryption formated client configuration file. diff -r 6d9040e07c32 -r 6c496a8ed2a9 opc_ua/client.py --- 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) diff -r 6d9040e07c32 -r 6c496a8ed2a9 tests/projects/opcua_client/opcua_0@opcua/confnode.xml --- 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 @@ - - - +