]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: separate acceptance criterias for Devices
authorJoshua Schmid <jschmid@suse.de>
Wed, 8 Jan 2020 16:10:36 +0000 (17:10 +0100)
committerSage Weil <sage@redhat.com>
Tue, 28 Jan 2020 16:09:38 +0000 (10:09 -0600)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
src/pybind/mgr/ansible/module.py
src/pybind/mgr/requirements.txt
src/pybind/mgr/rook/module.py
src/python-common/ceph/deployment/drive_selection/selector.py

index 0948f20a622e9488f784ad4cf5fb434b92b32582..1fd9732e15154e7a15760772e539e19e60caf3e3 100644 (file)
@@ -348,30 +348,33 @@ class Module(MgrModule, orchestrator.Orchestrator):
 
         return op
 
-    def create_osds(self, drive_group):
+    def create_osds(self, drive_groups):
         """Create one or more OSDs within a single Drive Group.
         If no host provided the operation affects all the host in the OSDS role
 
 
-        :param drive_group: (ceph.deployment.drive_group.DriveGroupSpec),
+        :param drive_groups: (ceph.deployment.drive_group.DriveGroupSpec),
                             Drive group with the specification of drives to use
         """
 
         # Transform drive group specification to Ansible playbook parameters
-        host, osd_spec = dg_2_ansible(drive_group)
-
-        # Create a new read completion object for execute the playbook
-        op = playbook_operation(client=self.ar_client,
-                                playbook=ADD_OSD_PLAYBOOK,
-                                result_pattern="",
-                                params=osd_spec,
-                                querystr_dict={"limit": host},
-                                output_wizard=ProcessPlaybookResult(self.ar_client),
-                                event_filter_list=["playbook_on_stats"])
-
-        self._launch_operation(op)
-
-        return op
+        ops = []
+        for drive_group in drive_groups:
+            host, osd_spec = dg_2_ansible(drive_group)
+
+            # Create a new read completion object for execute the playbook
+            op = playbook_operation(client=self.ar_client,
+                                    playbook=ADD_OSD_PLAYBOOK,
+                                    result_pattern="",
+                                    params=osd_spec,
+                                    querystr_dict={"limit": host},
+                                    output_wizard=ProcessPlaybookResult(self.ar_client),
+                                    event_filter_list=["playbook_on_stats"])
+
+            self._launch_operation(op)
+            ops.append(op)
+
+        return ops
 
     def remove_osds(self, osd_ids, destroy=False):
         """Remove osd's.
index 2b0e951104c7a2646e7c812507c119a2ffc8467e..21a5b35af45f2385c69b2d03232dfb7b4e8e637d 100644 (file)
@@ -3,4 +3,5 @@ mock; python_version <= '3.3'
 ipaddress; python_version < '3.3'
 ../../python-common
 kubernetes
-requests-mock
\ No newline at end of file
+requests-mock
+pyyaml
\ No newline at end of file
index 8f3dd1d85aa0a4686c9fd6c5611f70176b2b7da7..f76f6cd5a86cb438c0f382b2accf981c7de7f732 100644 (file)
@@ -370,7 +370,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
         )
 
     def create_osds(self, drive_group):
-        # type: (DriveGroupSpec) -> RookCompletion
+        # type: (List[DriveGroupSpec]) -> RookCompletion
 
         targets = []  # type: List[str]
         if drive_group.data_devices:
index 4a59fe5224f708938b6d95f395b437d0784a0f14..5a69ab09d2d153cfa66c9f9d115ae24273b387bc 100644 (file)
@@ -103,9 +103,15 @@ class DriveSelection(object):
 
         return a sorted(by path) list of devices
         """
-        if not device_filter and not self.spec.data_devices.paths:
+
+        if not device_filter:
             logger.debug('device_filter is None')
             return []
+
+        if not self.spec.data_devices:
+            logger.debug('data_devices is None')
+            return []
+
         devices = list()  # type: List[Device]
         for _filter in FilterGenerator(device_filter):
             if not _filter.is_matchable: