From 47784044dccbfc29a7bf24ac18dad8477f57bac7 Mon Sep 17 00:00:00 2001 From: Brian Chow <10820756+Brian-Chow@users.noreply.github.com> Date: Fri, 19 Jul 2024 15:44:36 -0700 Subject: [PATCH] Closes #16926 Adds various USB cable types to front/rear ports and cable choices --- netbox/dcim/choices.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/netbox/dcim/choices.py b/netbox/dcim/choices.py index fe8d8a158f6..1e09c574e38 100644 --- a/netbox/dcim/choices.py +++ b/netbox/dcim/choices.py @@ -1315,6 +1315,14 @@ class PortTypeChoices(ChoiceSet): TYPE_URM_P2 = 'urm-p2' TYPE_URM_P4 = 'urm-p4' TYPE_URM_P8 = 'urm-p8' + TYPE_USB_A = 'usb-a' + TYPE_USB_B = 'usb-b' + TYPE_USB_C = 'usb-c' + TYPE_USB_MINI_A = 'usb-mini-a' + TYPE_USB_MINI_B = 'usb-mini-b' + TYPE_USB_MICRO_A = 'usb-micro-a' + TYPE_USB_MICRO_B = 'usb-micro-b' + TYPE_USB_MICRO_AB = 'usb-micro-ab' TYPE_OTHER = 'other' CHOICES = ( @@ -1374,6 +1382,19 @@ class PortTypeChoices(ChoiceSet): (TYPE_SPLICE, 'Splice'), ), ), + ( + _('USB'), + ( + (TYPE_USB_A, 'USB-A'), + (TYPE_USB_B, 'USB-B'), + (TYPE_USB_C, 'USB-C'), + (TYPE_USB_MINI_A, 'USB-Mini-A'), + (TYPE_USB_MINI_B, 'USB-Mini-B'), + (TYPE_USB_MICRO_A, 'USB-Micro-A'), + (TYPE_USB_MICRO_B, 'USB-Micro-B'), + (TYPE_USB_MICRO_AB, 'USB-Micro-AB'), + ), + ), ( _('Other'), ( @@ -1412,6 +1433,14 @@ class CableTypeChoices(ChoiceSet): TYPE_SMF_OS2 = 'smf-os2' TYPE_AOC = 'aoc' TYPE_POWER = 'power' + TYPE_USB_A = 'usb-a' + TYPE_USB_B = 'usb-b' + TYPE_USB_C = 'usb-c' + TYPE_USB_MINI_A = 'usb-mini-a' + TYPE_USB_MINI_B = 'usb-mini-b' + TYPE_USB_MICRO_A = 'usb-micro-a' + TYPE_USB_MICRO_B = 'usb-micro-b' + TYPE_USB_MICRO_AB = 'usb-micro-ab' CHOICES = ( ( @@ -1444,6 +1473,18 @@ class CableTypeChoices(ChoiceSet): (TYPE_AOC, 'Active Optical Cabling (AOC)'), ), ), + ( + _('USB'), ( + (TYPE_USB_A, 'USB-A'), + (TYPE_USB_B, 'USB-B'), + (TYPE_USB_C, 'USB-C'), + (TYPE_USB_MINI_A, 'USB-Mini-A'), + (TYPE_USB_MINI_B, 'USB-Mini-B'), + (TYPE_USB_MICRO_A, 'USB-Micro-A'), + (TYPE_USB_MICRO_B, 'USB-Micro-B'), + (TYPE_USB_MICRO_AB, 'USB-Micro-AB'), + ), + ), (TYPE_POWER, _('Power')), )