From 40623681bb5e4244f53f44af1568703e1c8e7077 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Sun, 4 Oct 2020 01:17:13 +0800 Subject: [PATCH] [Mellanox] Fix truncated manufacture date returned from platform API (#5473) The manufacture date returned from platform API was truncated, time is not included. Revise the regular expression used for matching. --- platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py index 413388d203..7673c9130f 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py @@ -109,7 +109,7 @@ class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): for line in lines: try: - match = re.search('(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + match = re.search('(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+[\s]*[\S]*)', line) if match is not None: idx = match.group(1) value = match.group(3).rstrip('\0')