Skip to content

Commit

Permalink
ecmwf auth was failing due to being inherited from etcd auth, instead…
Browse files Browse the repository at this point in the history
… of is instance, == is used for type checking and proper comment is added for tox to ignore this
  • Loading branch information
sametd authored and jameshawkes committed Dec 15, 2023
1 parent 061e895 commit 42a4f50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyaviso/engine/etcd_grpc_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion pyaviso/engine/etcd_rest_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 42a4f50

Please sign in to comment.