migration: Superceed use of 'ceph mon rm'

Use the remove command (instead of rm) which is supported in
Ceph firefly or later (which covers all current deployment targets).

This resolves an issue with the ceph -> ceph-mon/ceph-osd migration
process for Luminous based deployments.

Change-Id: I127930e7c4b80465796b8270a9966b08f7c03037
Closes-Bug: 1729370
This commit is contained in:
James Page 2017-11-02 09:13:57 +00:00
parent b210d18d00
commit 0a298a732d
2 changed files with 3 additions and 2 deletions

View File

@ -667,7 +667,8 @@ def stop():
# Ensure monitor is removed from monmap prior to shutdown
# otherwise we end up with odd quorum loss issues during
# migration.
cmd = ['ceph', 'mon', 'rm', socket.gethostname()]
# NOTE(jamespage): remove is compat with >= firefly
cmd = ['ceph', 'mon', 'remove', socket.gethostname()]
subprocess.check_call(cmd)
# NOTE(jamespage)
# Pause MON and MGR processes running on this unit, leaving

View File

@ -313,7 +313,7 @@ class StopHookTestCase(unittest.TestCase):
ceph_conf_path.return_value = '/var/lib/charm/me/ceph.conf'
ceph_hooks.stop()
subprocess.check_call.assert_called_with(
['ceph', 'mon', 'rm', 'myself']
['ceph', 'mon', 'remove', 'myself']
)
if ceph_mgr:
service_pause.assert_has_calls([