Skip to content

Commit

Permalink
code: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
choppsv1 committed Aug 30, 2023
1 parent 466cd71 commit 1723075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions munet/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ def add_watch_log(self, path, watchfor_re=None):
path: If relative is relative to the nodes ``rundir``
watchfor_re: Regular expression to watch the log for and raise an exception
if found.
Return:
The watching task if request or None otherwise.
"""
Expand Down Expand Up @@ -964,7 +965,7 @@ async def add_host_intf(self, hname, lname, mtu=None):
self.host_intfs[hname] = lname

# See if this interace is missing and needs to be fixed
rc, o, e = self.unet.rootcmd.cmd_status(f"ip -o link show")
rc, o, _ = self.unet.rootcmd.cmd_status("ip -o link show")
m = re.search(rf"\d+:\s+(\S+):.*altname {re.escape(hname)}\W", o)
if m:
# need to rename
Expand All @@ -975,7 +976,7 @@ async def add_host_intf(self, hname, lname, mtu=None):
)
self.unet.rootcmd.cmd_status(f"ip link set {dname} name {hname}")

rc, o, e = self.unet.rootcmd.cmd_status(f"ip -o link show")
rc, o, _ = self.unet.rootcmd.cmd_status("ip -o link show")
m = re.search(rf"\d+:\s+{re.escape(hname)}:.*", o)
if m:
self.unet.rootcmd.cmd_nostatus(f"ip link set {hname} down ")
Expand Down
3 changes: 2 additions & 1 deletion munet/watchlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


class MatchFoundError(Exception):
"""An error raised when a match is not found."""
def __init__(self, watchlog, match):
self.watchlog = watchlog
self.match = match
Expand All @@ -28,6 +29,7 @@ def __init__(self, path, encoding="utf-8"):
Args:
path: that path of the logfile to watch
encoding: the encoding of the logfile
"""
# Immutable
self.path = Path(path)
Expand Down Expand Up @@ -160,7 +162,6 @@ def snapshot(self):
Return:
Newly added text.
"""

# Update the content which may reset marks
self.update_content()

Expand Down

0 comments on commit 1723075

Please sign in to comment.