diff --git a/changelog/undistributed/changelog_show_env_all_c9400_20250604141244.rst b/changelog/undistributed/changelog_show_env_all_c9400_20250604141244.rst new file mode 100644 index 0000000000..93c0e84932 --- /dev/null +++ b/changelog/undistributed/changelog_show_env_all_c9400_20250604141244.rst @@ -0,0 +1,6 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* IOSXE + * Modified ShowEnvironmentAll (c9400): + * Updated REGEX for "Sensor List: Environmental Monitoring" table. Accomodating for Location instead of Slot and also to catch more complex Locations such as Chassis2-4/0 diff --git a/src/genie/libs/parser/iosxe/cat9k/c9400/show_platform.py b/src/genie/libs/parser/iosxe/cat9k/c9400/show_platform.py index d910ddcfe2..c3f63893f4 100755 --- a/src/genie/libs/parser/iosxe/cat9k/c9400/show_platform.py +++ b/src/genie/libs/parser/iosxe/cat9k/c9400/show_platform.py @@ -159,7 +159,7 @@ class ShowEnvironmentAllSchema(MetaParser): Optional('minor_alarms'): int, 'sensor_list': { Any(): { - 'slot': { + 'location': { Any(): { 'sensor': { Any(): { @@ -243,7 +243,7 @@ def cli(self, include='', output=None): # V1: VX1 R0 Normal 869 mV na # Temp: inlet R0 Normal 32 Celsius (56 ,66 ,96 ,98 )(Celsius) p5 = re.compile( - r'(?P\S+(:\s+\S+)?)\s+(?P([A-Z][0-9]|\d/\d))\s+(?P\S+)\s+(?P\d+\s+\S+(\s+(AC|DC))?)\s+(\((?P\d+\s*),(?P\d+\s*),(?P\d+\s*),(?P\d+\s*)\)\((?P\S+)\))?' + r'(?P\S+(:\s+\S+)?)\s+(?P\S+[0-9])\s+(?P\S+)\s+(?P\d+\s+\S+(\s+(AC|DC))?)\s+(\((?P\d+\s*),(?P\d+\s*),(?P\d+\s*),(?P\d+\s*)\)\((?P\S+)\))?' ) # Power Fan States @@ -314,8 +314,8 @@ def cli(self, include='', output=None): if m: group = m.groupdict() sensor_name = group.pop('sensor_name') - slot = group.pop('slot') - fin_dict = sensor_dict.setdefault('slot', {}).setdefault(slot, {}).\ + location = group.pop('location') + fin_dict = sensor_dict.setdefault('location', {}).setdefault(location, {}).\ setdefault('sensor', {}).setdefault(sensor_name, {}) fin_dict['state'] = group['state']