]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: skip loopback devices when gathering facts
authorRedouane Kachach <rkachach@redhat.com>
Mon, 11 Apr 2022 11:04:13 +0000 (13:04 +0200)
committerAdam King <adking@redhat.com>
Tue, 3 May 2022 00:48:33 +0000 (20:48 -0400)
Fixes: https://tracker.ceph.com/issues/53528
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit a9eec9e3a7a53bd63d3bf9ced96e224fb752d9f7)

src/cephadm/cephadm

index 179732955c89b639de75891d7450c5f56ca295e3..866c461c610f42fa7ed9a0e08e06550a55770792 100755 (executable)
@@ -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'