From ed23a131dfc3e83526d6ab36b5d241f8198fe169 Mon Sep 17 00:00:00 2001 From: Jerome Lebleu Date: Fri, 14 Feb 2014 21:30:21 +0100 Subject: [PATCH] Always associate network interface's name to local_ip --- yunohost_monitor.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/yunohost_monitor.py b/yunohost_monitor.py index ed4f7db1..32fef40b 100644 --- a/yunohost_monitor.py +++ b/yunohost_monitor.py @@ -161,12 +161,9 @@ def monitor_network(units=None, human_readable=False): for name, addrs in devices.items(): if name == 'lo': continue - if len(devices) == 2: - l_ip = _extract_inet(addrs) - else: - if not isinstance(l_ip, dict): - l_ip = {} - l_ip[name] = _extract_inet(addrs) + if not isinstance(l_ip, dict): + l_ip = {} + l_ip[name] = _extract_inet(addrs) gateway = 'unknown' output = subprocess.check_output('ip route show'.split())