DATEFMT = '%Y-%m-%dT%H:%M:%S.%f'
-DAEMON_CACHE_PREFIX = "host.daemons."
+HOST_CACHE_PREFIX = "host."
# for py2 compat
try:
raise OrchestratorError(e)
-class DaemonCache():
+class HostCache():
def __init__(self, mgr):
# type: (CephadmOrchestrator) -> None
self.mgr = mgr
- self.data = {} # type: Dict[str, Dict[str, orchestrator.DaemonDescription]]
- self.last_update = {} # type: Dict[str, datetime.datetime]
+ self.daemons = {} # type: Dict[str, Dict[str, orchestrator.DaemonDescription]]
+ self.last_daemon_update = {} # type: Dict[str, datetime.datetime]
def load(self):
# type: () -> None
- for k, v in six.iteritems(self.mgr.get_store_prefix(DAEMON_CACHE_PREFIX)):
- host = k[len(DAEMON_CACHE_PREFIX):]
+ for k, v in six.iteritems(self.mgr.get_store_prefix(HOST_CACHE_PREFIX)):
+ host = k[len(HOST_CACHE_PREFIX):]
if host not in self.mgr.inventory:
- self.mgr.log.warning('removing stray DaemonCache host record %s' % (
+ self.mgr.log.warning('removing stray HostCache host record %s' % (
host))
self.mgr.set_store(k, None)
try:
j = json.loads(v)
- # we do ignore the persisted last_update to trigger a new
+ # we do ignore the persisted last_*_update to trigger a new
# scrape on mgr restart
- self.data[host] = {}
+ self.daemons[host] = {}
for name, d in j.get('daemons', {}).items():
- self.data[host][name] = \
+ self.daemons[host][name] = \
orchestrator.DaemonDescription.from_json(d)
- self.mgr.log.debug('DaemonCache.load: host %s has %d daemons' % (
- host, len(self.data[host])))
+ self.mgr.log.debug('HostCache.load: host %s has %d daemons' % (
+ host, len(self.daemons[host])))
except Exception as e:
self.mgr.log.warning('unable to load cached state for %s: %s' % (
host, e))
pass
- def update_host(self, host, dm):
+ def update_host_daemons(self, host, dm):
# type: (str, Dict[str, orchestrator.DaemonDescription]) -> None
- self.data[host] = dm
- self.last_update[host] = datetime.datetime.utcnow()
+ self.daemons[host] = dm
+ self.last_daemon_update[host] = datetime.datetime.utcnow()
def prime_empty_host(self, host):
# type: (str) -> None
"""
Install an empty entry for a host
"""
- self.data[host] = {}
+ self.daemons[host] = {}
- def invalidate_host(self, host):
+ def invalidate_host_daemons(self, host):
# type: (str) -> None
- if host in self.last_update:
- del self.last_update[host]
+ if host in self.last_daemon_update:
+ del self.last_daemon_update[host]
def save_host(self, host):
# type: (str) -> None
j = { # type: ignore
'daemons': {},
}
- if host in self.last_update:
- j['last_update'] = self.last_update[host].strftime(DATEFMT) # type: ignore
- for name, dd in self.data[host].items():
+ if host in self.last_daemon_update:
+ j['last_daemon_update'] = self.last_daemon_update[host].strftime(DATEFMT) # type: ignore
+ for name, dd in self.daemons[host].items():
j['daemons'][name] = dd.to_json()
- self.mgr.set_store(DAEMON_CACHE_PREFIX + host, json.dumps(j))
+ self.mgr.set_store(HOST_CACHE_PREFIX + host, json.dumps(j))
def rm_host(self, host):
# type: (str) -> None
- if host in self.data:
- del self.data[host]
- if host in self.last_update:
- del self.last_update[host]
- self.mgr.set_store(DAEMON_CACHE_PREFIX + host, None)
+ if host in self.daemons:
+ del self.daemons[host]
+ if host in self.last_daemon_update:
+ del self.last_daemon_update[host]
+ self.mgr.set_store(HOST_CACHE_PREFIX + host, None)
def get_hosts(self):
# type: () -> List[str]
r = []
- for host, di in self.data.items():
+ for host, di in self.daemons.items():
r.append(host)
return r
def get_daemons(self):
# type: () -> List[orchestrator.DaemonDescription]
r = []
- for host, dm in self.data.items():
+ for host, dm in self.daemons.items():
for name, dd in dm.items():
r.append(dd)
return r
def get_daemons_by_type(self, daemon_type):
# type: (str) -> List[orchestrator.DaemonDescription]
result = [] # type: List[orchestrator.DaemonDescription]
- for host, dm in self.data.items():
+ for host, dm in self.daemons.items():
for name, d in dm.items():
if name.startswith(daemon_type + '.'):
result.append(d)
def get_daemon_names(self):
# type: () -> List[str]
r = []
- for host, dm in self.data.items():
+ for host, dm in self.daemons.items():
for name, dd in dm.items():
r.append(name)
return r
- def host_needs_refresh(self, host):
+ def host_needs_daemon_refresh(self, host):
# type: (str) -> bool
cutoff = datetime.datetime.utcnow() - datetime.timedelta(
seconds=self.mgr.daemon_cache_timeout)
- if host not in self.last_update or self.last_update[host] < cutoff:
+ if host not in self.last_daemon_update or self.last_daemon_update[host] < cutoff:
return True
return False
def add_daemon(self, host, dd):
# type: (str, orchestrator.DaemonDescription) -> None
- assert host in self.data
- self.data[host][dd.name()] = dd
+ assert host in self.daemons
+ self.daemons[host][dd.name()] = dd
def rm_daemon(self, host, name):
- if host in self.data:
- if name in self.data[host]:
- del self.data[host][name]
+ if host in self.daemons:
+ if name in self.daemons[host]:
+ del self.daemons[host][name]
class AsyncCompletion(orchestrator.Completion):
self.inventory_cache = orchestrator.OutdatablePersistentDict(
self, self._STORE_HOST_PREFIX + '.devices')
- self.daemon_cache = DaemonCache(self)
- self.daemon_cache.load()
+ self.cache = HostCache(self)
+ self.cache.load()
# ensure the host lists are in sync
for h in self.inventory.keys():
if h not in self.inventory_cache:
self.log.debug('adding inventory item for %s' % h)
self.inventory_cache[h] = orchestrator.OutdatableData()
- if h not in self.daemon_cache.data:
+ if h not in self.cache.daemons:
self.log.debug('adding service item for %s' % h)
- self.daemon_cache.prime_empty_host(h)
+ self.cache.prime_empty_host(h)
for h in self.inventory_cache:
if h not in self.inventory:
del self.inventory_cache[h]
- for h in self.daemon_cache.get_hosts():
+ for h in self.cache.get_hosts():
if h not in self.inventory:
- self.daemon_cache.rm_host(h)
+ self.cache.rm_host(h)
def shutdown(self):
self.log.info('shutdown')
if opt['name'] == 'container_image':
image_settings[opt['section']] = opt['value']
- daemons = self.daemon_cache.get_daemons()
+ daemons = self.cache.get_daemons()
for daemon_type in ['mgr', 'mon', 'osd', 'rgw', 'mds']:
self.log.info('Upgrade: Checking %s daemons...' % daemon_type)
del self.health_checks[k]
if self.warn_on_stray_hosts or self.warn_on_stray_daemons:
ls = self.list_servers()
- managed = self.daemon_cache.get_daemon_names()
+ managed = self.cache.get_daemon_names()
host_detail = [] # type: List[str]
host_num_daemons = 0
daemon_detail = [] # type: List[str]
# refresh daemons
self.log.debug('refreshing daemons')
failures = []
- for host in self.daemon_cache.get_hosts():
- if self.daemon_cache.host_needs_refresh(host):
+ for host in self.cache.get_hosts():
+ if self.cache.host_needs_daemon_refresh(host):
self.log.debug('refreshing %s' % host)
r = self._refresh_host_daemons(host)
if r:
}
self._save_inventory()
self.inventory_cache[spec.hostname] = orchestrator.OutdatableData()
- self.daemon_cache.prime_empty_host(spec.hostname)
+ self.cache.prime_empty_host(spec.hostname)
self.event.set() # refresh stray health check
return "Added host '{}'".format(spec.hostname)
del self.inventory[host]
self._save_inventory()
del self.inventory_cache[host]
- self.daemon_cache.rm_host(host)
+ self.cache.rm_host(host)
self._reset_con(host)
self.event.set() # refresh stray health check
return "Removed host '{}'".format(host)
sd.status = None
dm[sd.name()] = sd
self.log.debug('Refreshed host %s daemons: %s' % (host, dm))
- self.daemon_cache.update_host(host, dm)
+ self.cache.update_host_daemons(host, dm)
return None
for host, hi in self.inventory.items():
self._refresh_host_daemons(host)
sm = {} # type: Dict[str, orchestrator.ServiceDescription]
- for h, dm in self.daemon_cache.data.items():
+ for h, dm in self.cache.daemons.items():
for name, dd in dm.items():
if service_type and service_type != dd.daemon_type:
continue
for host, hi in self.inventory.items():
self._refresh_host_daemons(host)
result = []
- for h, dm in self.daemon_cache.data.items():
+ for h, dm in self.cache.daemons.items():
if host and h != host:
continue
for name, dd in dm.items():
self.log.debug('service_action action %s name %s' % (
action, service_name))
args = []
- for host, dm in self.daemon_cache.data.items():
+ for host, dm in self.cache.daemons.items():
for name, d in dm.items():
if d.matches_service(service_name):
args.append((d.daemon_type, d.daemon_id,
host, name, 'unit',
['--name', name, a],
error_ok=True)
- self.daemon_cache.invalidate_host(host)
+ self.cache.invalidate_host_daemons(host)
self.log.debug('_daemon_action code %s out %s' % (code, out))
return "{} {} from host '{}'".format(action, name, host)
action, daemon_type, daemon_id))
args = []
- for host, dm in self.daemon_cache.data.items():
+ for host, dm in self.cache.daemons.items():
for name, d in dm.items():
if d.daemon_type == daemon_type and d.daemon_id == daemon_id:
args.append((d.daemon_type, d.daemon_id,
def remove_daemons(self, names, force):
# type: (List[str], bool) -> orchestrator.Completion
args = []
- for host, dm in self.daemon_cache.data.items():
+ for host, dm in self.cache.daemons.items():
for name in names:
if name in dm:
args.append((name, host, force))
def remove_service(self, service_name):
args = []
- for host, dm in self.daemon_cache.data.items():
+ for host, dm in self.cache.daemons.items():
for name, d in dm.items():
if d.matches_service(service_name):
args.append(
] + extra_args,
stdin=j)
self.log.debug('create_daemon code %s out %s' % (code, out))
- if not code and host in self.daemon_cache.data:
+ if not code and host in self.cache.daemons:
# prime cached service state with what we (should have)
# just created
sd = orchestrator.DaemonDescription()
sd.nodename = host
sd.status = 1
sd.status_desc = 'starting'
- self.daemon_cache.add_daemon(host, sd)
- self.daemon_cache.invalidate_host(host)
+ self.cache.add_daemon(host, sd)
+ self.cache.invalidate_host_daemons(host)
self.event.set()
return "{} {} on host '{}'".format(
'Reconfigured' if reconfig else 'Deployed', name, host)
self.log.debug('_remove_daemon code %s out %s' % (code, out))
if not code:
# remove item from cache
- self.daemon_cache.rm_daemon(host, name)
- self.daemon_cache.invalidate_host(host)
+ self.cache.rm_daemon(host, name)
+ self.cache.invalidate_host_daemons(host)
return "Removed {} from host '{}'".format(name, host)
def _update_service(self, daemon_type, add_func, spec):
- daemons = self.daemon_cache.get_daemons_by_type(daemon_type)
+ daemons = self.cache.get_daemons_by_type(daemon_type)
if len(daemons) > spec.count:
# remove some
to_remove = len(daemons) - spec.count
daemon_type: str,
spec: orchestrator.ServiceSpec,
create_func: Callable):
- daemons = self.daemon_cache.get_daemons_by_type(daemon_type)
+ daemons = self.cache.get_daemons_by_type(daemon_type)
args = []
num_added = 0
assert spec.count is not None
# current support requires a network to be specified
orchestrator.servicespec_validate_hosts_have_network_spec(spec)
- daemons = self.daemon_cache.get_daemons_by_type('mon')
+ daemons = self.cache.get_daemons_by_type('mon')
for _, _, name in spec.placement.hosts:
if name and len([d for d in daemons if d.daemon_id == name]):
raise RuntimeError('name %s already exists', name)
# current support requires a network to be specified
orchestrator.servicespec_validate_hosts_have_network_spec(spec)
- daemons = self.daemon_cache.get_daemons_by_type('mon')
+ daemons = self.cache.get_daemons_by_type('mon')
for _, _, name in spec.placement.hosts:
if name and len([d for d in daemons if d.daemon_id == name]):
raise RuntimeError('name %s alrady exists', name)
"""
spec = NodeAssignment(spec=spec, get_hosts_func=self._get_hosts, service_type='mgr').load()
- daemons = self.daemon_cache.get_daemons_by_type('mgr')
+ daemons = self.cache.get_daemons_by_type('mgr')
num_mgrs = len(daemons)
if spec.count == num_mgrs:
return orchestrator.Completion(value="The requested number of managers exist.")
'needs_update': dict(),
'up_to_date': list(),
}
- for host, dm in self.daemon_cache.data.items():
+ for host, dm in self.cache.daemons.items():
for name, dd in dm.items():
if target_id == dd.container_image_id:
r['up_to_date'].append(dd.name())
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('[]'))
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_host(self, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
assert wait(cephadm_module, cephadm_module.get_hosts()) == [InventoryNode('test')]
assert wait(cephadm_module, c) == []
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('[]'))
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_service_ls(self, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
c = cephadm_module.list_daemons(refresh=True)
assert wait(cephadm_module, c) == []
@mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('[]'))
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_device_ls(self, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
c = cephadm_module.get_inventory()
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_daemon_action(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
cephadm_module.service_cache_timeout = 10
with self._with_host(cephadm_module, 'test'):
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_mon_update(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test:0.0.0.0=a'], count=1)
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_mgr_update(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test:0.0.0.0=a'], count=1)
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_create_osds(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
dg = DriveGroupSpec('test', data_devices=DeviceSelection(paths=['']))
)
])
))
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_remove_osds(self, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
c = cephadm_module.list_daemons(refresh=True)
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_mds(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test'], count=1)
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_rgw(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_rgw_update(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'host1'):
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_rgw_update_fail(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'host1'):
)
])
))
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_remove_daemon(self, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
c = cephadm_module.list_daemons(refresh=True)
)
])
))
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_remove_service(self, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
c = cephadm_module.list_daemons(refresh=True)
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_rbd_mirror(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
# type: (mock.Mock, mock.Mock, mock.Mock, mock.Mock, CephadmOrchestrator) -> None
with self._with_host(cephadm_module, 'test'):
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_prometheus(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
ps = PlacementSpec(hosts=['test'], count=1)
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_node_exporter(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
# type: (mock.Mock, mock.Mock, mock.Mock, mock.Mock, CephadmOrchestrator) -> None
with self._with_host(cephadm_module, 'test'):
@mock.patch("cephadm.module.CephadmOrchestrator.send_command")
@mock.patch("cephadm.module.CephadmOrchestrator.mon_command", mon_command)
@mock.patch("cephadm.module.CephadmOrchestrator._get_connection")
- @mock.patch("cephadm.module.DaemonCache.save_host")
- @mock.patch("cephadm.module.DaemonCache.rm_host")
+ @mock.patch("cephadm.module.HostCache.save_host")
+ @mock.patch("cephadm.module.HostCache.rm_host")
def test_blink_device_light(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):
with self._with_host(cephadm_module, 'test'):
c = cephadm_module.blink_device_light('ident', True, [('test', '', '')])