Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wlp* and enp* to the list of supported interfaces in host_agent.py #2058

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion host_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@
REDIS_ARGS = dict(host="127.0.0.1", port=6379, db=0)
# Name of redis channel to listen to
CHANNEL_NAME = b'hostcmd'
SUPPORTED_INTERFACES = (
'wlan',
'eth',
'wlp',
'enp',
)


def get_ip_addresses():
addresses = []

for interface in netifaces.interfaces():
if not (interface.startswith('wlan') or interface.startswith('eth')):
if not interface.startswith(SUPPORTED_INTERFACES):
continue

addrs = netifaces.ifaddresses(interface)
Expand Down
Loading