From: Redouane Kachach Date: Mon, 11 Apr 2022 11:04:13 +0000 (+0200) Subject: mgr/cephadm: skip loopback devices when gathering facts X-Git-Tag: v17.2.1~73^2~30 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8cff011366c218c6425efad8f65f473556f30d9b;p=ceph.git mgr/cephadm: skip loopback devices when gathering facts Fixes: https://tracker.ceph.com/issues/53528 Signed-off-by: Redouane Kachach (cherry picked from commit a9eec9e3a7a53bd63d3bf9ced96e224fb752d9f7) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 179732955c89..866c461c610f 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -7757,6 +7757,17 @@ class HostFacts(): continue for iface in os.listdir(nic_path): + if os.path.exists(os.path.join(nic_path, iface, 'bridge')): + nic_type = 'bridge' + elif os.path.exists(os.path.join(nic_path, iface, 'bonding')): + nic_type = 'bonding' + else: + logger.info(os.path.join(nic_path, iface, 'type')) + nic_type = hw_lookup.get(read_file([os.path.join(nic_path, iface, 'type')]), 'Unknown') + + if nic_type == 'loopback': # skip loopback devices + continue + lower_devs_list = [os.path.basename(link.replace('lower_', '')) for link in glob(os.path.join(nic_path, iface, 'lower_*'))] upper_devs_list = [os.path.basename(link.replace('upper_', '')) for link in glob(os.path.join(nic_path, iface, 'upper_*'))] @@ -7775,13 +7786,6 @@ class HostFacts(): # Either way, we show a -1 when speed isn't available speed = -1 - if os.path.exists(os.path.join(nic_path, iface, 'bridge')): - nic_type = 'bridge' - elif os.path.exists(os.path.join(nic_path, iface, 'bonding')): - nic_type = 'bonding' - else: - nic_type = hw_lookup.get(read_file([os.path.join(nic_path, iface, 'type')]), 'Unknown') - dev_link = os.path.join(nic_path, iface, 'device') if os.path.exists(dev_link): iftype = 'physical'