From 17024d6e4685759a99160279cdd462537e4b885c Mon Sep 17 00:00:00 2001 From: sametd Date: Fri, 15 Dec 2023 01:09:47 +0100 Subject: [PATCH] ecmwf auth was failing due to being inherited from etcd auth, instead of is instance, == is used for type checking and proper comment is added for tox to ignore this --- pyaviso/engine/etcd_grpc_engine.py | 2 +- pyaviso/engine/etcd_rest_engine.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyaviso/engine/etcd_grpc_engine.py b/pyaviso/engine/etcd_grpc_engine.py index 2e94ded..e071c00 100644 --- a/pyaviso/engine/etcd_grpc_engine.py +++ b/pyaviso/engine/etcd_grpc_engine.py @@ -33,7 +33,7 @@ def __init__(self, config: EngineConfig, auth: Auth): self._base_url = f"http://{self._host}:{self._port}/v3/" def _initialise_server(self): - if isinstance(self.auth, EtcdAuth): + if type(self.auth) == EtcdAuth: # noqa: E721 self._server = Etcd3Client( self.host, self.port, user=self.auth.username, password=self.auth.password, timeout=self.timeout ) diff --git a/pyaviso/engine/etcd_rest_engine.py b/pyaviso/engine/etcd_rest_engine.py index 32938e5..8a0c28b 100644 --- a/pyaviso/engine/etcd_rest_engine.py +++ b/pyaviso/engine/etcd_rest_engine.py @@ -247,7 +247,7 @@ def _authenticate(self) -> bool: This method authenticates the user and set the internal token, this is only done for Etcd authentication :return: True if successfully authenticated """ - if isinstance(self.auth, EtcdAuth): + if type(self.auth) == EtcdAuth: # noqa: E721 logger.debug(f"Authenticating user {self.auth.username}...") url = self._base_url + "auth/authenticate"