]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix raw activate by osd-id/osd-uuid
authorGuillaume Abrioux <gabrioux@ibm.com>
Thu, 29 Jun 2023 08:19:37 +0000 (10:19 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 15 May 2024 09:12:56 +0000 (09:12 +0000)
When activating a raw osd with `--osd-id` and `--osd-uuid` instead of
passing the device, it ends up with a call to List.generate() passing
`[None]` (which doesn't really make sense).
When no devices are passed tp List.generate(), it needs to enter the
first condition in order to build a list of all devices. Otherwise,
that function starts iterating on an empty list which result in a
failure (see corresponding tracker).

Fixes: https://tracker.ceph.com/issues/61855
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit b25e8e4ecc8f4187cf1f185e0e0f5a72aafe6a10)

src/ceph-volume/ceph_volume/devices/raw/activate.py

index 9323b18f98034944caf3b14c99e907117e8de626..38c74ef9829a6db7933febf59659dd3751fd855a 100644 (file)
@@ -82,7 +82,9 @@ class Activate(object):
             return
         self.args = parser.parse_args(self.argv)
 
-        devs = [self.args.device]
+        devs = []
+        if self.args.device:
+            devs = [self.args.device]
         if self.args.block_wal:
             devs.append(self.args.block_wal)
         if self.args.block_db: