From 43b949779d33a4e0da60111f84ed0de39b8ef70a Mon Sep 17 00:00:00 2001 From: bchow <10820756+Brian-Chow@users.noreply.github.com> Date: Mon, 9 Sep 2024 07:49:04 -0700 Subject: [PATCH] Closes #16926 Adds various USB cable types to front/rear ports and cable choices (#16951) * Closes #16926 Adds various USB cable types to front/rear ports and cable choices * Closes #16926 Changes USB cable types to reflect versions-physical differences. Updated human readable labels on USB front/rear ports to match style of usb console ports * Closes #16926 Removes USB cable type choices in favor of single, generic 'USB' cable --- netbox/dcim/choices.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/netbox/dcim/choices.py b/netbox/dcim/choices.py index d75b2f48966..549c62a8a25 100644 --- a/netbox/dcim/choices.py +++ b/netbox/dcim/choices.py @@ -1347,6 +1347,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 = ( @@ -1406,6 +1414,19 @@ class PortTypeChoices(ChoiceSet): (TYPE_SPLICE, 'Splice'), ), ), + ( + _('USB'), + ( + (TYPE_USB_A, 'USB Type A'), + (TYPE_USB_B, 'USB Type B'), + (TYPE_USB_C, 'USB Type 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'), ( @@ -1444,6 +1465,7 @@ class CableTypeChoices(ChoiceSet): TYPE_SMF_OS2 = 'smf-os2' TYPE_AOC = 'aoc' TYPE_POWER = 'power' + TYPE_USB = 'usb' CHOICES = ( ( @@ -1476,6 +1498,7 @@ class CableTypeChoices(ChoiceSet): (TYPE_AOC, 'Active Optical Cabling (AOC)'), ), ), + (TYPE_USB, _('USB')), (TYPE_POWER, _('Power')), )