Skip to content

Commit

Permalink
Relax switchgroup count and vendor requirements (tests missing)
Browse files Browse the repository at this point in the history
We now allow more than two switches per switchgroup and also allow
mixed-vendor switchgroups. We need this for some experimental setups in
our qa regions where we want to have certain pairs to be configured in
the same way.
  • Loading branch information
sebageek committed Aug 7, 2024
1 parent 489c568 commit 756c83b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions networking_ccloud/common/config/config_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,9 @@ def vlan_pool(self):

@pydantic.validator('members')
def validate_members(cls, v):
# we currently plan with having exactly two members in each group
if len(v) != 2:
raise ValueError(f"Expected two switch members, got {len(v)} - "
"the code should work with other member counts, but this "
"should be checked beforehand")

# members need to be of the same platform
platforms = set(s.platform for s in v)
if len(platforms) > 1:
raise ValueError("Switchgroup members need to have the same platform! Found {}"
.format(", ".join(f"{s.name} of type {s.platform}" for s in v)))
# we currently plan having two or more members in each group
if len(v) < 2:
raise ValueError(f"Expected two or more switch members, got {len(v)}")

return v

Expand Down

0 comments on commit 756c83b

Please sign in to comment.