Rename shuffle profiles

This commit is contained in:
Jeremy Stretch
2025-12-15 14:30:41 -05:00
parent 52745e39ee
commit c1ce532422
4 changed files with 34 additions and 43 deletions

View File

@@ -296,7 +296,7 @@ class Breakout1C6Px6C1PCableProfile(BaseCableProfile):
}
class Shuffle2C4PCableProfile(BaseCableProfile):
class Trunk2C4PShuffleCableProfile(BaseCableProfile):
a_connectors = {
1: 4,
2: 4,
@@ -314,7 +314,7 @@ class Shuffle2C4PCableProfile(BaseCableProfile):
}
class Shuffle4C4PCableProfile(BaseCableProfile):
class Trunk4C4PShuffleCableProfile(BaseCableProfile):
a_connectors = {
1: 4,
2: 4,
@@ -342,10 +342,7 @@ class Shuffle4C4PCableProfile(BaseCableProfile):
}
class ShuffleBreakout2x8CableProfile(BaseCableProfile):
"""
Temporary solution for mapping 2 front/rear ports to 8 discrete interfaces
"""
class Breakout2C4Px8C1PShuffleCableProfile(BaseCableProfile):
a_connectors = {
1: 4,
2: 4,

View File

@@ -1734,66 +1734,60 @@ class CableProfileChoices(ChoiceSet):
TRUNK_2C1P = 'trunk-2c1p'
TRUNK_2C2P = 'trunk-2c2p'
TRUNK_2C4P = 'trunk-2c4p'
TRUNK_2C4P_SHUFFLE = 'trunk-2c4p-shuffle'
TRUNK_2C6P = 'trunk-2c6p'
TRUNK_2C8P = 'trunk-2c8p'
TRUNK_2C12P = 'trunk-2c12p'
TRUNK_4C1P = 'trunk-4c1p'
TRUNK_4C2P = 'trunk-4c2p'
TRUNK_4C4P = 'trunk-4c4p'
TRUNK_4C4P_SHUFFLE = 'trunk-4c4p-shuffle'
TRUNK_4C6P = 'trunk-4c6p'
TRUNK_4C8P = 'trunk-4c8p'
TRUNK_8C4P = 'trunk-8c4p'
# Breakouts
BREAKOUT_1C4P_4C1P = 'breakout-1c4p-4c1p'
BREAKOUT_1C6P_6C1P = 'breakout-1c6p-6c1p'
SHUFFLE_BREAKOUT_2X8 = 'shuffle-breakout-2x8'
# Shuffles
SHUFFLE_2C4P = 'shuffle-2c4p'
SHUFFLE_4C4P = 'shuffle-4c4p'
BREAKOUT_2C4P_8C1P_SHUFFLE = 'breakout-2c4p-8c1p-shuffle'
CHOICES = (
(
_('Single'),
(
(SINGLE_1C1P, _('Single (1C1P)')),
(SINGLE_1C2P, _('Single (1C2P)')),
(SINGLE_1C4P, _('Single (1C4P)')),
(SINGLE_1C6P, _('Single (1C6P)')),
(SINGLE_1C8P, _('Single (1C8P)')),
(SINGLE_1C12P, _('Single (1C12P)')),
(SINGLE_1C16P, _('Single (1C16P)')),
(SINGLE_1C1P, _('1C1P')),
(SINGLE_1C2P, _('1C2P')),
(SINGLE_1C4P, _('1C4P')),
(SINGLE_1C6P, _('1C6P')),
(SINGLE_1C8P, _('1C8P')),
(SINGLE_1C12P, _('1C12P')),
(SINGLE_1C16P, _('1C16P')),
),
),
(
_('Trunk'),
(
(TRUNK_2C1P, _('Trunk (2C1P)')),
(TRUNK_2C2P, _('Trunk (2C2P)')),
(TRUNK_2C4P, _('Trunk (2C4P)')),
(TRUNK_2C6P, _('Trunk (2C6P)')),
(TRUNK_2C8P, _('Trunk (2C8P)')),
(TRUNK_2C12P, _('Trunk (2C12P)')),
(TRUNK_4C1P, _('Trunk (4C1P)')),
(TRUNK_4C2P, _('Trunk (4C2P)')),
(TRUNK_4C4P, _('Trunk (4C4P)')),
(TRUNK_4C6P, _('Trunk (4C6P)')),
(TRUNK_4C8P, _('Trunk (4C8P)')),
(TRUNK_8C4P, _('Trunk (8C4P)')),
(TRUNK_2C1P, _('2C1P trunk')),
(TRUNK_2C2P, _('2C2P trunk')),
(TRUNK_2C4P, _('2C4P trunk')),
(TRUNK_2C4P_SHUFFLE, _('2C4P trunk (shuffle)')),
(TRUNK_2C6P, _('2C6P trunk')),
(TRUNK_2C8P, _('2C8P trunk')),
(TRUNK_2C12P, _('2C12P trunk')),
(TRUNK_4C1P, _('4C1P trunk')),
(TRUNK_4C2P, _('4C2P trunk')),
(TRUNK_4C4P, _('4C4P trunk')),
(TRUNK_4C4P_SHUFFLE, _('4C4P trunk (shuffle)')),
(TRUNK_4C6P, _('4C6P trunk')),
(TRUNK_4C8P, _('4C8P trunk')),
(TRUNK_8C4P, _('8C4P trunk')),
),
),
(
_('Breakout'),
(
(BREAKOUT_1C4P_4C1P, _('Breakout (1C4P/4C1P)')),
(BREAKOUT_1C6P_6C1P, _('Breakout (1C6P/6C1P)')),
),
),
(
_('Shuffle'),
(
(SHUFFLE_2C4P, _('Shuffle (2C4P)')),
(SHUFFLE_4C4P, _('Shuffle (4C4P)')),
(SHUFFLE_BREAKOUT_2X8, _('Shuffle breakout (2x8)')),
(BREAKOUT_1C4P_4C1P, _('1C4P:4C1P breakout')),
(BREAKOUT_1C6P_6C1P, _('1C6P:6C1P breakout')),
(BREAKOUT_2C4P_8C1P_SHUFFLE, _('2C4P:8C1P breakout (shuffle)')),
),
),
)

View File

@@ -147,20 +147,20 @@ class Cable(PrimaryModel):
CableProfileChoices.TRUNK_2C1P: cable_profiles.Trunk2C1PCableProfile,
CableProfileChoices.TRUNK_2C2P: cable_profiles.Trunk2C2PCableProfile,
CableProfileChoices.TRUNK_2C4P: cable_profiles.Trunk2C4PCableProfile,
CableProfileChoices.TRUNK_2C4P_SHUFFLE: cable_profiles.Trunk2C4PShuffleCableProfile,
CableProfileChoices.TRUNK_2C6P: cable_profiles.Trunk2C6PCableProfile,
CableProfileChoices.TRUNK_2C8P: cable_profiles.Trunk2C8PCableProfile,
CableProfileChoices.TRUNK_2C12P: cable_profiles.Trunk2C12PCableProfile,
CableProfileChoices.TRUNK_4C1P: cable_profiles.Trunk4C1PCableProfile,
CableProfileChoices.TRUNK_4C2P: cable_profiles.Trunk4C2PCableProfile,
CableProfileChoices.TRUNK_4C4P: cable_profiles.Trunk4C4PCableProfile,
CableProfileChoices.TRUNK_4C4P_SHUFFLE: cable_profiles.Trunk4C4PShuffleCableProfile,
CableProfileChoices.TRUNK_4C6P: cable_profiles.Trunk4C6PCableProfile,
CableProfileChoices.TRUNK_4C8P: cable_profiles.Trunk4C8PCableProfile,
CableProfileChoices.TRUNK_8C4P: cable_profiles.Trunk8C4PCableProfile,
CableProfileChoices.BREAKOUT_1C4P_4C1P: cable_profiles.Breakout1C4Px4C1PCableProfile,
CableProfileChoices.BREAKOUT_1C6P_6C1P: cable_profiles.Breakout1C6Px6C1PCableProfile,
CableProfileChoices.SHUFFLE_2C4P: cable_profiles.Shuffle2C4PCableProfile,
CableProfileChoices.SHUFFLE_4C4P: cable_profiles.Shuffle4C4PCableProfile,
CableProfileChoices.SHUFFLE_BREAKOUT_2X8: cable_profiles.ShuffleBreakout2x8CableProfile,
CableProfileChoices.BREAKOUT_2C4P_8C1P_SHUFFLE: cable_profiles.Breakout2C4Px8C1PShuffleCableProfile,
}.get(self.profile)
def _get_x_terminations(self, side):

View File

@@ -710,7 +710,7 @@ class CablePathTests(CablePathTestCase):
cable.save()
cables.append(cable)
shuffle_cable = Cable(
profile=CableProfileChoices.SHUFFLE_2C4P,
profile=CableProfileChoices.TRUNK_2C4P_SHUFFLE,
a_terminations=rear_ports[0:2],
b_terminations=rear_ports[2:4],
)