]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: Fix unbound var in disk.get_devices() 59262/head
authorZack Cerza <zack@redhat.com>
Thu, 7 Sep 2023 18:58:22 +0000 (11:58 -0700)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sat, 17 Aug 2024 10:53:45 +0000 (17:53 +0700)
00ba00fdfab8 looks to have regressed.

Signed-off-by: Zack Cerza <zack@redhat.com>
(cherry picked from commit 0e95b27402e46c34586f460d2140af48d03fa305)

src/ceph-volume/ceph_volume/util/disk.py

index 2984c391d069ff91ffbfb8f02c1a3d6f676ec74a..a0bc39b9d179ac8c7d8f6fa3c754683c49a9df85 100644 (file)
@@ -865,6 +865,7 @@ def get_devices(_sys_block_path='/sys/block', device=''):
         for key, file_ in facts:
             metadata[key] = get_file_contents(os.path.join(sysdir, file_))
 
+        device_slaves = []
         if block[2] != 'part':
             device_slaves = os.listdir(os.path.join(sysdir, 'slaves'))
             metadata['partitions'] = get_partitions_facts(sysdir)