diff --git a/actions/pause_resume.py b/actions/pause_resume.py index f918994a..4d10b759 100755 --- a/actions/pause_resume.py +++ b/actions/pause_resume.py @@ -46,7 +46,10 @@ def pause(args): @raises OSError if it can't get the local osd ids. """ for local_id in get_local_osd_ids(): - cmd = ['ceph', 'osd', 'out', str(local_id)] + cmd = [ + 'ceph', + '--id', 'osd-upgrade', + 'osd', 'out', str(local_id)] check_call(cmd) set_unit_paused() assess_status() @@ -59,12 +62,14 @@ def resume(args): @raises OSError if the unit can't get the local osd ids """ for local_id in get_local_osd_ids(): - cmd = ['ceph', 'osd', 'in', str(local_id)] + cmd = [ + 'ceph', + '--id', 'osd-upgrade', + 'osd', 'in', str(local_id)] check_call(cmd) clear_unit_paused() assess_status() - # A dictionary of all the defined actions to callables (which take # parsed arguments). ACTIONS = {"pause": pause, "resume": resume} diff --git a/unit_tests/test_actions_pause_resume.py b/unit_tests/test_actions_pause_resume.py index 1d2fe072..b0ac4418 100644 --- a/unit_tests/test_actions_pause_resume.py +++ b/unit_tests/test_actions_pause_resume.py @@ -24,7 +24,6 @@ import pause_resume as actions class PauseTestCase(CharmTestCase): - def setUp(self): super(PauseTestCase, self).setUp( actions, ["check_call", @@ -35,14 +34,14 @@ class PauseTestCase(CharmTestCase): def test_pauses_services(self): self.get_local_osd_ids.return_value = [5] actions.pause([]) - cmd = ['ceph', 'osd', 'out', '5'] + cmd = ['ceph', '--id', + 'osd-upgrade', 'osd', 'out', '5'] self.check_call.assert_called_once_with(cmd) self.set_unit_paused.assert_called_once_with() self.assess_status.assert_called_once_with() class ResumeTestCase(CharmTestCase): - def setUp(self): super(ResumeTestCase, self).setUp( actions, ["check_call", @@ -53,14 +52,14 @@ class ResumeTestCase(CharmTestCase): def test_pauses_services(self): self.get_local_osd_ids.return_value = [5] actions.resume([]) - cmd = ['ceph', 'osd', 'in', '5'] + cmd = ['ceph', '--id', + 'osd-upgrade', 'osd', 'in', '5'] self.check_call.assert_called_once_with(cmd) self.clear_unit_paused.assert_called_once_with() self.assess_status.assert_called_once_with() class MainTestCase(CharmTestCase): - def setUp(self): super(MainTestCase, self).setUp(actions, ["action_fail"])