Skip to content

Commit

Permalink
Fix arping methods not handling whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostofGoes committed Dec 10, 2021
1 parent 2a0f986 commit 2a22827
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ to bring new members into the community, and can always use the help.
(cursing/swearing), NSFW text/content, or racism are NOT ok.

## Checklist before submitting a pull request
* [ ] Code is formatted with Black: `black getmac tests`
* [ ] All tests run and pass locally
* [ ] `tox`
* [ ] `tox -e check`
Expand Down
4 changes: 2 additions & 2 deletions getmac/getmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def _arping_habets(host):
"""Parse https://github.com/ThomasHabets/arping output."""
return _search(
r"^%s$" % MAC_RE_COLON,
_popen("arping", "-r -C 1 -c 1 %s" % host),
_popen("arping", "-r -C 1 -c 1 %s" % host).strip(),
)


Expand All @@ -404,7 +404,7 @@ def _arping_iputils(host):
"""Parse iputils arping output."""
return _search(
r" from %s \[(%s)\]" % (re.escape(host), MAC_RE_COLON),
_popen("arping", "-f -c 1 %s" % host),
_popen("arping", "-f -c 1 %s" % host).strip(),
)


Expand Down

0 comments on commit 2a22827

Please sign in to comment.