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: v18.0.0~1066^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a9eec9e3a7a53bd63d3bf9ced96e224fb752d9f7;p=ceph.git mgr/cephadm: skip loopback devices when gathering facts Fixes: https://tracker.ceph.com/issues/53528 Signed-off-by: Redouane Kachach --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 004219bb6a37..8a4e6187f4cd 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -7652,6 +7652,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_*'))] @@ -7670,13 +7681,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'