Skip to content

Commit

Permalink
Roles Equals func
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBurchLog committed Jun 13, 2024
1 parent 4daaf21 commit c97d4ce
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions brewtils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,22 @@ def __repr__(self):
self.scope_commands,
)

def __eq__(self, other):
if not isinstance(other, Role):
# don't attempt to compare against unrelated types
return NotImplemented

return (
self.name == other.name
and self.description == other.description
and self.scope_gardens == other.scope_gardens
and self.scope_namespaces == other.scope_namespaces
and self.scope_systems == other.scope_systems
and self.scope_instances == other.scope_instances
and self.scope_versions == other.scope_versions
and self.scope_commands == other.scope_commands
)


class UpstreamRole(Role):
schema = "UpstreamRoleSchema"
Expand Down

0 comments on commit c97d4ce

Please sign in to comment.