From: Joshua Schmid Date: Wed, 8 Jan 2020 16:10:36 +0000 (+0100) Subject: mgr/cephadm: separate acceptance criterias for Devices X-Git-Tag: v15.1.1~612^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6774a8d03c5ca7cffca317f80df7710b4d66cc8d;p=ceph-ci.git mgr/cephadm: separate acceptance criterias for Devices Signed-off-by: Joshua Schmid --- diff --git a/src/pybind/mgr/ansible/module.py b/src/pybind/mgr/ansible/module.py index 0948f20a622..1fd9732e151 100644 --- a/src/pybind/mgr/ansible/module.py +++ b/src/pybind/mgr/ansible/module.py @@ -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. diff --git a/src/pybind/mgr/requirements.txt b/src/pybind/mgr/requirements.txt index 2b0e951104c..21a5b35af45 100644 --- a/src/pybind/mgr/requirements.txt +++ b/src/pybind/mgr/requirements.txt @@ -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 diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 8f3dd1d85aa..f76f6cd5a86 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -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: diff --git a/src/python-common/ceph/deployment/drive_selection/selector.py b/src/python-common/ceph/deployment/drive_selection/selector.py index 4a59fe5224f..5a69ab09d2d 100644 --- a/src/python-common/ceph/deployment/drive_selection/selector.py +++ b/src/python-common/ceph/deployment/drive_selection/selector.py @@ -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: