Skip to content

Commit

Permalink
Allow passing kwargs to the AMQPClient in CluClient
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Dec 5, 2024
1 parent 6f6826a commit 573a24f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.4.4 - December 5, 2024

### ✨ Improved

* Allow passing kwargs to the `AMQPClient` in `CluClient`.


## 0.4.3 - November 29, 2024

### 🚀 New
Expand Down
6 changes: 3 additions & 3 deletions src/lvmopstools/clu.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CluClient:
__initialised: bool = False
__instance: CluClient | None = None

def __new__(cls, host: str | None = None, port: int | None = None):
def __new__(cls, host: str | None = None, port: int | None = None, **kwargs):
if (
cls.__instance is None
or (host is not None and cls.__instance.host != host)
Expand All @@ -68,7 +68,7 @@ def __new__(cls, host: str | None = None, port: int | None = None):

return cls.__instance

def __init__(self, host: str | None = None, port: int | None = None):
def __init__(self, host: str | None = None, port: int | None = None, **kwargs):
if self.__initialised is True:
# Bail out if we are returning a singleton instance
# which is already initialised.
Expand All @@ -80,7 +80,7 @@ def __init__(self, host: str | None = None, port: int | None = None):
self.host: str = host or host_default
self.port: int = port or port_default

self.client = AMQPClient(host=self.host, port=self.port)
self.client = AMQPClient(host=self.host, port=self.port, **kwargs)
self.__initialised = True

self._lock = asyncio.Lock()
Expand Down

0 comments on commit 573a24f

Please sign in to comment.