deps.append(dd.name())
return sorted(deps)
- def _deploy_cephadm_binary(self, host: str) -> bool:
- # Use tee (from coreutils) to create a copy of cephadm on the target machine
- self.log.info(f"Deploying cephadm binary to {host}")
- with self._remote_connection(host) as tpl:
- conn, _connr = tpl
- _out, _err, code = remoto.process.check(
- conn,
- ['tee', '-', '/var/lib/ceph/{}/cephadm'.format(self._cluster_fsid)],
- stdin=self._cephadm.encode('utf-8'))
- return code == 0
-
@forall_hosts
def _remove_daemons(self, name: str, host: str) -> str:
return CephadmServe(self)._remove_daemon(name, host)
if daemon_spec.daemon_type == 'cephadm-exporter':
if not reconfig:
assert daemon_spec.host
- deploy_ok = self.mgr._deploy_cephadm_binary(daemon_spec.host)
+ deploy_ok = self._deploy_cephadm_binary(daemon_spec.host)
if not deploy_ok:
msg = f"Unable to deploy the cephadm binary to {daemon_spec.host}"
self.log.warning(msg)
if code:
return f"Host {host} failed to login to {url} as {username} with given password"
return None
+
+ def _deploy_cephadm_binary(self, host: str) -> bool:
+ # Use tee (from coreutils) to create a copy of cephadm on the target machine
+ self.log.info(f"Deploying cephadm binary to {host}")
+ with self.mgr._remote_connection(host) as tpl:
+ conn, _connr = tpl
+ _out, _err, code = remoto.process.check(
+ conn,
+ ['tee', '-', '/var/lib/ceph/{}/cephadm'.format(self.mgr._cluster_fsid)],
+ stdin=self.mgr._cephadm.encode('utf-8'))
+ return code == 0
(ServiceSpec('cephadm-exporter'), CephadmOrchestrator.add_cephadm_exporter),
]
)
- @mock.patch("cephadm.module.CephadmOrchestrator._deploy_cephadm_binary", _deploy_cephadm_binary('test'))
+ @mock.patch("cephadm.serve.CephadmServe._deploy_cephadm_binary", _deploy_cephadm_binary('test'))
@mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
@mock.patch("cephadm.services.cephadmservice.RgwService.create_realm_zonegroup_zone", lambda _, __, ___: None)
def test_daemon_add(self, spec: ServiceSpec, meth, cephadm_module):
(ServiceSpec('cephadm-exporter'), CephadmOrchestrator.apply_cephadm_exporter),
]
)
- @mock.patch("cephadm.module.CephadmOrchestrator._deploy_cephadm_binary", _deploy_cephadm_binary('test'))
+ @mock.patch("cephadm.serve.CephadmServe._deploy_cephadm_binary", _deploy_cephadm_binary('test'))
@mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
@mock.patch("cephadm.services.cephadmservice.RgwService.create_realm_zonegroup_zone", lambda _, __, ___: None)
def test_apply_save(self, spec: ServiceSpec, meth, cephadm_module: CephadmOrchestrator):