From 0a298a732de881fc566f5a41c942535c3b7657a4 Mon Sep 17 00:00:00 2001 From: James Page Date: Thu, 2 Nov 2017 09:13:57 +0000 Subject: [PATCH] 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 --- hooks/ceph_hooks.py | 3 ++- unit_tests/test_ceph_hooks.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hooks/ceph_hooks.py b/hooks/ceph_hooks.py index 225cc18..2868777 100755 --- a/hooks/ceph_hooks.py +++ b/hooks/ceph_hooks.py @@ -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 diff --git a/unit_tests/test_ceph_hooks.py b/unit_tests/test_ceph_hooks.py index ac89a1a..b7439e0 100644 --- a/unit_tests/test_ceph_hooks.py +++ b/unit_tests/test_ceph_hooks.py @@ -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([