Merge "Delete ceph-mon when sysinv system delete host"

This commit is contained in:
Zuul 2019-06-20 20:27:57 +00:00 committed by Gerrit Code Review
commit 46059b70b5
2 changed files with 11 additions and 0 deletions

View File

@ -1541,3 +1541,13 @@ class CephOperator(object):
'Reason: %(reason)s') % {
'pool_name': pool['pool_name'],
'reason': str(e.message)})
def remove_ceph_monitor(self, hostname, timeout=None):
try:
response, body = self._ceph_api.mon_remove(hostname, body='json',
timeout=timeout)
if not response.ok:
LOG.error("Remove monitor error reponse: {} {}"
.format(response, body))
except Exception as e:
LOG.error("Exception in removing monitor: {}".format(e))

View File

@ -1406,6 +1406,7 @@ class ConductorManager(service.PeriodicService):
LOG.info("Deleting ceph monitor for host %s"
% str(host.hostname))
self.dbapi.ceph_mon_destroy(mon[0].uuid)
self._ceph.remove_ceph_monitor(host.hostname)
else:
LOG.info("No ceph monitor present for host %s. "
"Skipping deleting ceph monitor."