Merge "Restart radosgw during upgrade-ceph"

This commit is contained in:
Jenkins 2016-09-20 09:09:48 +00:00 committed by Gerrit Code Review
commit 660754c3f9
3 changed files with 20 additions and 0 deletions

View File

@ -167,6 +167,7 @@ def upgrade_ceph(orig_id, seed_id):
"env-{0}-ceph.conf.tar.gz".format(orig_id)) "env-{0}-ceph.conf.tar.gz".format(orig_id))
conf_filename, db_path = extract_mon_conf_files(orig_env, tar_filename) conf_filename, db_path = extract_mon_conf_files(orig_env, tar_filename)
ceph_set_new_mons(orig_env, seed_env, tar_filename, conf_filename, db_path) ceph_set_new_mons(orig_env, seed_env, tar_filename, conf_filename, db_path)
ceph.restart_radosgw(seed_env)
def upgrade_ceph_with_graph(orig_id, seed_id): def upgrade_ceph_with_graph(orig_id, seed_id):

View File

@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock
import pytest import pytest
from octane.util import ceph from octane.util import ceph
@ -35,3 +37,15 @@ def test_get_ceph_conf_filename(mocker, node, cmd_output, conf_file):
"octane.util.ssh.call_output", return_value=cmd_output) "octane.util.ssh.call_output", return_value=cmd_output)
assert conf_file == ceph.get_ceph_conf_filename(node) assert conf_file == ceph.get_ceph_conf_filename(node)
mock_ssh.assert_called_once_with(cmd, node=node) mock_ssh.assert_called_once_with(cmd, node=node)
def test_restart_radowgw(mocker):
mock_get = mocker.patch("octane.util.env.get_one_controller")
mock_call = mocker.patch("octane.util.ssh.call")
mock_env = mock.Mock()
ceph.restart_radosgw(mock_env)
mock_get.assert_called_once_with(mock_env)
mock_call.assert_called_once_with(["service", "radosgw", "restart"],
node=mock_get.return_value)

View File

@ -48,3 +48,8 @@ def get_ceph_conf_filename(node):
if value == '-c' and i < len(cmdline): if value == '-c' and i < len(cmdline):
return cmdline[i + 1] return cmdline[i + 1]
return '/etc/ceph/ceph.conf' return '/etc/ceph/ceph.conf'
def restart_radosgw(env):
node = env_util.get_one_controller(env)
ssh.call(["service", "radosgw", "restart"], node=node)