spec = ServiceSpec.from_json(json_spec)
assert isinstance(spec, DriveGroupSpec)
c = cephadm_module.apply_drivegroups([spec])
+ assert wait(cephadm_module, c) == ['Scheduled osd update...']
_save_spec.assert_called_with(spec)
- assert wait(cephadm_module, c[0]) == 'Scheduled osd update...'
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
@mock.patch("cephadm.module.SpecStore.save")
spec = ServiceSpec.from_json(json_spec)
assert isinstance(spec, DriveGroupSpec)
c = cephadm_module.apply_drivegroups([spec])
+ assert wait(cephadm_module, c) == ['Scheduled osd update...']
_save_spec.assert_called_with(spec)
- assert wait(cephadm_module, c[0]) == 'Scheduled osd update...'
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
def test_create_osds(self, cephadm_module):
"""
raise NotImplementedError()
- def apply_drivegroups(self, specs: List[DriveGroupSpec]) -> Sequence[Completion]:
+ def apply_drivegroups(self, specs: List[DriveGroupSpec]) -> Completion:
""" Update OSD cluster """
raise NotImplementedError()
)
]
- completions = self.apply_drivegroups(dg_specs)
- [self._orchestrator_wait([completion]) for completion in completions] # type: ignore
- [raise_if_exception(completion) for completion in completions] # type: ignore
- result_strings = [completion.result_str() for completion in completions]
- return HandleCommandResult(stdout=" ".join(result_strings))
+ completion = self.apply_drivegroups(dg_specs)
+ self._orchestrator_wait([completion])
+ raise_if_exception(completion)
+ return HandleCommandResult(stdout=completion.result_str())
@_cli_write_command(
'orch daemon add osd',
)
def apply_drivegroups(self, specs):
- # type: (List[DriveGroupSpec]) -> Sequence[TestCompletion]
+ # type: (List[DriveGroupSpec]) -> TestCompletion
drive_group = specs[0]
def run(all_hosts):
# type: (List[orchestrator.HostSpec]) -> None
if drive_group.placement.host_pattern:
if not drive_group.placement.pattern_matches_hosts([h.hostname for h in all_hosts]):
raise orchestrator.OrchestratorValidationError('failed to match')
- return [self.get_hosts().then(run).then(
+ return self.get_hosts().then(run).then(
on_complete=orchestrator.ProgressReference(
message='apply_drivesgroups',
mgr=self,
)
- )]
+ )
@deferred_write("remove_daemons")
def remove_daemons(self, names):