aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-05-22 13:28:11 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:53 -0800
commite9a1af171eecb333326b3d791fd6516788ec7cac (patch)
treeff2a7f1c4f53e414aa6aa78c00a2ca5e87b1fc53 /mpm
parentd52ec83e908028929994656c13d7bf988d3ce2ad (diff)
downloaduhd-e9a1af171eecb333326b3d791fd6516788ec7cac.tar.gz
uhd-e9a1af171eecb333326b3d791fd6516788ec7cac.tar.bz2
uhd-e9a1af171eecb333326b3d791fd6516788ec7cac.zip
mpm: Better handling of case where no CHDR interfaces are available
Diffstat (limited to 'mpm')
-rw-r--r--mpm/python/usrp_mpm/net.py3
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/mpm/python/usrp_mpm/net.py b/mpm/python/usrp_mpm/net.py
index 29c1bcab9..78895a0bb 100644
--- a/mpm/python/usrp_mpm/net.py
+++ b/mpm/python/usrp_mpm/net.py
@@ -37,7 +37,8 @@ def get_valid_interfaces(iface_list):
continue
valid_iface_idx = valid_iface_idx[0]
link_info = ipr.get_links(valid_iface_idx)[0]
- if link_info.get_attr('IFLA_OPERSTATE') == 'UP':
+ if link_info.get_attr('IFLA_OPERSTATE') == 'UP' \
+ and len(get_iface_addrs(link_info.get_attr('IFLA_ADDRESS'))):
assert link_info.get_attr('IFLA_IFNAME') == iface
valid_ifaces.append(iface)
ipr.close()
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index 846797c20..022464476 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -353,7 +353,10 @@ class PeriphManagerBase(object):
self.chdr_interfaces
))
valid_ifaces = net.get_valid_interfaces(self.chdr_interfaces)
- self.log.debug("Found CHDR interfaces: `{}'".format(valid_ifaces))
+ if len(valid_ifaces):
+ self.log.debug("Found CHDR interfaces: `{}'".format(valid_ifaces))
+ else:
+ self.log.warning("No CHDR interfaces found!")
self._chdr_interfaces = {
x: net.get_iface_info(x)
for x in valid_ifaces