Skip to content

Commit

Permalink
Adding Tag System Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBurchLog committed Dec 5, 2023
1 parent f31996d commit b012174
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions brewtils/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def client(self, new_client):
client_clazz._bg_version = self._system.version
client_clazz._bg_commands = self._system.commands
client_clazz._current_request = client_clazz.current_request
client_clazz._tags = client_clazz._system.tags
except TypeError:
if sys.version_info.major != 2:
raise
Expand Down Expand Up @@ -509,6 +510,7 @@ def _initialize_system(self):
"display_name": self._system.display_name,
"icon_name": self._system.icon_name,
"template": self._system.template,
"tags": self._system.tags,
}

# And if this particular instance doesn't exist we want to add it
Expand Down
5 changes: 5 additions & 0 deletions brewtils/rest/easy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ def update_system(self, system_id, new_commands=None, **kwargs):
display_name (str): New System display name
icon_name (str): New System icon name
template (str): New System template
tags (list): New System Tags
Returns:
System: The updated system
Expand All @@ -417,6 +418,10 @@ def update_system(self, system_id, new_commands=None, **kwargs):
if metadata:
operations.append(PatchOperation("update", "/metadata", metadata))

tags = kwargs.pop("tags", [])
if metadata:
operations.append(PatchOperation("update", "/tags", tags))

# The remaining kwargs are all strings
# Sending an empty string (instead of None) ensures they're actually cleared
for key, value in kwargs.items():
Expand Down

0 comments on commit b012174

Please sign in to comment.