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:
parent
7de16ef0e9
commit
4b2114f835
@ -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):
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user