Merge "Use osd-upgrade user for pause/resume"

This commit is contained in:
Jenkins 2016-07-20 04:08:31 +00:00 committed by Gerrit Code Review
commit e93f6756d5
3 changed files with 16 additions and 4 deletions

View File

@ -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,7 +62,10 @@ 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()

View File

@ -349,6 +349,10 @@ osd_upgrade_caps = {
'allow command "config-key put"',
'allow command "config-key get"',
'allow command "config-key exists"',
'allow command "osd out"',
'allow command "osd in"',
'allow command "osd rm"',
'allow command "auth del"',
]
}

View File

@ -43,7 +43,8 @@ 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()
@ -61,7 +62,8 @@ 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()