diff --git a/tests/generic_config_updater/test_portchannel_interface.py b/tests/generic_config_updater/test_portchannel_interface.py index 288bab0c1bb..047de48b439 100644 --- a/tests/generic_config_updater/test_portchannel_interface.py +++ b/tests/generic_config_updater/test_portchannel_interface.py @@ -247,7 +247,12 @@ def verify_attr_change(duthost, po_name, attr, value): ... """ if attr == "mtu": - output = duthost.shell("show interfaces status | grep -w '^{}' | awk '{{print $4}}'".format(po_name)) + cmd = ( + "show interfaces status | " + "grep -w '^[[:space:]]*{}' | " + "awk '{{print $4}}'" + ).format(po_name) + output = duthost.shell(cmd) pytest_assert(output['stdout'] == value, "{} attribute {} failed to change to {}".format(po_name, attr, value)) elif attr == "min_links":