Restart radosgw during upgrade-ceph

The radosgw have to be restarted during the upgrade of Ceph otherwise
the object store will be unavailable on the primary controller.

Change-Id: If949b24a6176c3c65ff4c26b089b4997bd991cb5
Related-Bug: #1624341
This commit is contained in:
Ilya Kharin 2016-09-19 22:27:58 +03:00
parent 7de16ef0e9
commit 4b2114f835
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))
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.restart_radosgw(seed_env)
def upgrade_ceph_with_graph(orig_id, seed_id):

View File

@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import pytest
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)
assert conf_file == ceph.get_ceph_conf_filename(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):
return cmdline[i + 1]
return '/etc/ceph/ceph.conf'
def restart_radosgw(env):
node = env_util.get_one_controller(env)
ssh.call(["service", "radosgw", "restart"], node=node)