Skip to content

Commit

Permalink
Rename matcher to match
Browse files Browse the repository at this point in the history
  • Loading branch information
kennylau-arista committed Oct 24, 2023
1 parent 4563edc commit 7740a07
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pytest_netdut/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ def _sku(request):
ssh = request.getfixturevalue(f"{name}_ssh")
assert ssh.cli_flavor in {"eos", "mos"}
output = ssh.sendcmd("show version", timeout=300)
matcher = re.search(r"(DCS-7.*)", output)
logging.info("Got SKU: %s", matcher.group(1))
yield matcher.group(1)
match = re.search(r"(DCS-7.*)", output)
logging.info("Got SKU: %s", match.group(1))
yield match.group(1)

return _sku

Expand All @@ -164,15 +164,15 @@ def _os_version(request):
assert ssh.cli_flavor in {"eos", "mos"}
output = ssh.sendcmd("show version", timeout=300)
if ssh.cli_flavor == "mos":
matcher = re.search(r"Software image version: (\S*)", output)
match = re.search(r"Software image version: (\S*)", output)
else:
# On release SWIs the "Sofware image version" only contains the version, e.g.
# Software image version: 4.31.0F
# Architecture: x86_64
# Internal build version: 4.31.0F-33797590.4310F
matcher = re.search(r"Internal build version: (\S*)", output)
logging.info("Got OS version: %s", matcher.group(1))
yield matcher.group(1)
match = re.search(r"Internal build version: (\S*)", output)
logging.info("Got OS version: %s", match.group(1))
yield match.group(1)

return _os_version

Expand Down

0 comments on commit 7740a07

Please sign in to comment.