Skip to content

Commit

Permalink
merged not equal routes are not defaultable
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Mar 28, 2024
1 parent 293c1b4 commit 5295658
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spinn_machine/routing_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ def merge(self, other: RoutingEntry) -> RoutingEntry:
If the key and mask of the other entry do not match
"""
# 2 different merged routes can NEVER be defaultable
if self == other:
return self
return RoutingEntry(
spinnaker_route=self.spinnaker_route | other.spinnaker_route,
defaultable=self.defaultable and other.defaultable)
defaultable=False)

def __eq__(self, other_entry: Any) -> bool:
if not isinstance(other_entry, RoutingEntry):
Expand Down

0 comments on commit 5295658

Please sign in to comment.