]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume lvm.batch update module to use Device object on strategy detection
authorAlfredo Deza <adeza@redhat.com>
Thu, 23 Aug 2018 16:55:30 +0000 (12:55 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 24 Aug 2018 15:18:03 +0000 (11:18 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/devices/lvm/batch.py

index 66df90ae4ca0c15ebc721569d8164c39b0dbf148..c38613f09f606fdf21d9555fe10923c0a500ae4c 100644 (file)
@@ -2,7 +2,6 @@ import argparse
 from textwrap import dedent
 from ceph_volume import terminal, decorators
 from ceph_volume.util import disk, prompt_bool
-from ceph_volume.util.device import Device
 from ceph_volume.util import arg_validators
 from . import strategies
 
@@ -16,7 +15,7 @@ def device_formatter(devices):
     for path, details in devices:
         lines.append(device_list_template.format(
             path=path, size=details['human_readable_size'],
-            state='solid' if details['rotational'] == '0' else 'rotational')
+            state='solid' if details.sys_api['rotational'] == '0' else 'rotational')
         )
 
     return ''.join(lines)
@@ -28,7 +27,7 @@ def bluestore_single_type(device_facts):
     Detect devices that are just HDDs or solid state so that a 1:1
     device-to-osd provisioning can be done
     """
-    types = [device['rotational'] for device in device_facts]
+    types = [device.sys_api['rotational'] for device in device_facts]
     if len(set(types)) == 1:
         return strategies.bluestore.SingleType
 
@@ -38,7 +37,7 @@ def bluestore_mixed_type(device_facts):
     Detect if devices are HDDs as well as solid state so that block.db can be
     placed in solid devices while data is kept in the spinning drives.
     """
-    types = [device['rotational'] for device in device_facts]
+    types = [device.sys_api['rotational'] for device in device_facts]
     if len(set(types)) > 1:
         return strategies.bluestore.MixedType
 
@@ -48,7 +47,7 @@ def filestore_single_type(device_facts):
     Detect devices that are just HDDs or solid state so that a 1:1
     device-to-osd provisioning can be done, keeping the journal on the OSD
     """
-    types = [device['rotational'] for device in device_facts]
+    types = [device.sys_api['rotational'] for device in device_facts]
     if len(set(types)) == 1:
         return strategies.filestore.SingleType