ossobv / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
0 stars 0 forks source link

build: (minor) hwsku_json_checker and platform_json_checker have improper regex escape #49

Open wdoekes opened 10 hours ago

wdoekes commented 10 hours ago

Description

New python3 warnings.

--- a/src/sonic-device-data/tests/hwsku_json_checker
+++ b/src/sonic-device-data/tests/hwsku_json_checker
@@ -8,7 +8,7 @@ import sys
 # Global variable
 PORT_ATTRIBUTES = ["default_brkout_mode"]
 OPTIONAL_PORT_ATTRIBUTES = ["fec", "autoneg", "port_type", "subport", "role"]
-PORT_REG = "Ethernet(\d+)"
+PORT_REG = r"Ethernet(\d+)"
 HWSKU_JSON = '*hwsku.json'
 INTF_KEY = "interfaces"

diff --git a/src/sonic-device-data/tests/platform_json_checker b/src/sonic-device-data/tests/platform_json_checker
index 7b92936b9..f1865bf7b 100755
--- a/src/sonic-device-data/tests/platform_json_checker
+++ b/src/sonic-device-data/tests/platform_json_checker
@@ -8,7 +8,7 @@ import sys
 # Global variable
 PORT_ATTRIBUTES = ["index", "lanes", "breakout_modes"]
 ATTR_LEN = len(PORT_ATTRIBUTES)
-PORT_REG = "Ethernet(\d+)"
+PORT_REG = r"Ethernet(\d+)"
 PLATFORM_JSON = '*platform.json'
 INTF_KEY = "interfaces"
 CHASSIS_KEY = "chassis"

Needs PR upstream.

Which build are we running (if any)

master + 202405

Upstream issues/PRs