Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Condition and filename
Browse files Browse the repository at this point in the history
  • Loading branch information
westwardharbor0 committed Jun 15, 2022
1 parent 9156dd6 commit fde88ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ethtool-exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ def whitelist_blacklist_check(self, stat_name: str) -> bool:
:return: Bool if statistic is allowed.
"""
if self.args.whitelist_regex:
return re.match(self.args.whitelist_regex, stat_name) is None
return re.match(self.args.whitelist_regex, stat_name) is not None
if self.args.blacklist_regex:
return re.match(self.args.blacklist_regex, stat_name) is not None
return re.match(self.args.blacklist_regex, stat_name) is None
return True

def run_ethtool(self, interface: str, parameter: str) -> Optional[bytes]:
Expand Down Expand Up @@ -470,7 +470,7 @@ def find_physical_interfaces(self) -> list[str]:
if (
file.is_symlink()
and "virtual" not in str(file.readlink().resolve())
and re.match(self.args.interface_regex, str(file.resolve()))
and re.match(self.args.interface_regex, file.name)
)
]

Expand Down

0 comments on commit fde88ef

Please sign in to comment.