]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: skip loopback devices when gathering facts 45851/head
authorRedouane Kachach <rkachach@redhat.com>
Mon, 11 Apr 2022 11:04:13 +0000 (13:04 +0200)
committerRedouane Kachach <rkachach@redhat.com>
Mon, 11 Apr 2022 11:04:13 +0000 (13:04 +0200)
Fixes: https://tracker.ceph.com/issues/53528
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
src/cephadm/cephadm

index 004219bb6a373a9db5db1f801e49986f3cc02498..8a4e6187f4cd04d79f6ab86d572171ab76c83e46 100755 (executable)
@@ -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'