] + extra_args,
stdin=j)
self.log.debug('create_daemon code %s out %s' % (code, out))
+ if not code:
+ # prime cached service state with what we (should have)
+ # just created
+ sd = {
+ 'style': 'cephadm:v1',
+ 'name': '%s.%s' % (daemon_type, daemon_id),
+ 'fsid': self._cluster_fsid,
+ 'enabled': True,
+ 'state': 'running',
+ }
+ data = self.service_cache[host].data
+ if data:
+ data.append(sd)
+ else:
+ data = [sd]
+ self.service_cache[host] = orchestrator.OutdatableData(data)
self.service_cache.invalidate(host)
+ self.event.set()
return "{} {} on host '{}'".format(
'Reconfigured' if reconfig else 'Deployed', name, host)
cephadm_module._cluster_fsid = "fsid"
cephadm_module.service_cache_timeout = 10
with self._with_host(cephadm_module, 'test'):
+ c = cephadm_module.describe_service(refresh=True)
+ wait(cephadm_module, c)
c = cephadm_module.service_action('redeploy', 'rgw', service_id='myrgw.foobar')
assert wait(cephadm_module, c) == ["Deployed rgw.myrgw.foobar on host 'test'"]
def test_remove_osds(self, cephadm_module):
cephadm_module._cluster_fsid = "fsid"
with self._with_host(cephadm_module, 'test'):
+ c = cephadm_module.describe_service(refresh=True)
+ wait(cephadm_module, c)
c = cephadm_module.remove_osds(['0'])
out = wait(cephadm_module, c)
assert out == ["Removed osd.0 from host 'test'"]
def test_remove_rgw(self, cephadm_module):
cephadm_module._cluster_fsid = "fsid"
with self._with_host(cephadm_module, 'test'):
+ c = cephadm_module.describe_service(refresh=True)
+ wait(cephadm_module, c)
c = cephadm_module.remove_rgw('myrgw')
out = wait(cephadm_module, c)
assert out == ["Removed rgw.myrgw.foobar from host 'test'"]