diff --git a/devices/clients/opcua_connection.py b/devices/clients/opcua_connection.py index 6b4a5b8221ca46bd150487d681c6b0ec63699fd9..c5fa45507afc60dedb21c2d972861acedee827de 100644 --- a/devices/clients/opcua_connection.py +++ b/devices/clients/opcua_connection.py @@ -90,7 +90,7 @@ class OPCUAConnection(CommClient): try: self.client.disconnect() except Exception as e: - self.streams.error_stream("Disconnect from OPC-UA server %s failed: %s", self._servername(), e) + self.streams.error_stream("Disconnect from OPC-UA server {} failed: {}".format(self._servername(), e)) def ping(self): """ @@ -99,7 +99,7 @@ class OPCUAConnection(CommClient): try: self.client.send_hello() except Exception as e: - raise Exception("Lost connection to server %s: %s", self._servername(), e) + raise Exception("Lost connection to server {}.".format(self._servername())) from e def _setup_annotation(self, annotation): """ @@ -115,13 +115,12 @@ class OPCUAConnection(CommClient): elif isinstance(annotation, list): path = annotation else: - raise Exception("OPC-ua mapping requires either a list of the path or dict with the path. Was given %s type containing: %s", type(annotation), annotation) + raise Exception("OPC-ua mapping requires either a list of the path or dict with the path. Was given {} type containing: {}".format(type(annotation), annotation)) try: node = self.obj.get_child(path) except Exception as e: - self.streams.error_stream("Could not get node: %s on server %s: %s", path, self._servername(), e) - raise Exception("Could not get node: %s on server %s", path, self._servername()) from e + raise Exception("Could not get node: {} on server {}".format(path, self._servername())) from e return node