Handle Duplex parsing on some version of iosxr (#38738)

* Handle Duplex parsing on some version of iosxr

* use re noncapture group for multiple match as suggested by Eric
This commit is contained in:
Deepak Agrawal
2018-04-18 13:22:08 +05:30
committed by GitHub
parent 8173602a34
commit bdd105f740

View File

@@ -307,7 +307,7 @@ class Interfaces(FactsBase):
return int(match.group(1))
def parse_duplex(self, data):
match = re.search(r'(\w+) Duplex', data, re.M)
match = re.search(r'(\w+)(?: D|-d)uplex', data, re.M)
if match:
return match.group(1)