Skip to content

Commit

Permalink
fixed logic in client parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBurchLog committed Oct 30, 2024
1 parent 3fc2dc4 commit a37cbb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions brewtils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,9 @@ def _parse_shutdown_functions(client):
shutdown_functions = []

for attr in dir(client):
if callable(attr) and getattr(attr, "_shutdown", False):
shutdown_functions.append(attr)
method = getattr(client, attr)
if callable(method) and getattr(method, "_shutdown", False):
shutdown_functions.append(method)

return shutdown_functions

Expand Down
4 changes: 2 additions & 2 deletions brewtils/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def __init__(self, client=None, system=None, logger=None, **kwargs):
# Need to pop out shutdown functions because these are not processed
# until shutdown
self._arg_shutdown_functions = kwargs.pop("shutdown_functions", [])
if hasattr(kwargs, "shutdown_function"):
if "shutdown_function" in kwargs:
self._arg_shutdown_functions.append(kwargs.pop("shutdown_function"))

# Now that logging is configured we can load the real config
Expand Down Expand Up @@ -541,7 +541,7 @@ def _shutdown(self, status="STOPPED"):

self._logger.debug("About to run annotated shutdown functions")
executed_shutdown_functions = self._run_shutdown_functions(
_parse_shutdown_functions(self.client)
_parse_shutdown_functions(self._client)
)

self._logger.debug("About to run plugin shutdown functions")
Expand Down

0 comments on commit a37cbb3

Please sign in to comment.