Browse Source

Merge "Restart radosgw during upgrade-ceph"

stable/newton
Jenkins 2 years ago
parent
commit
660754c3f9
3 changed files with 20 additions and 0 deletions
  1. 1
    0
      octane/commands/upgrade_ceph.py
  2. 14
    0
      octane/tests/test_ceph.py
  3. 5
    0
      octane/util/ceph.py

+ 1
- 0
octane/commands/upgrade_ceph.py View File

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

+ 14
- 0
octane/tests/test_ceph.py View File

@@ -10,6 +10,8 @@
10 10
 # License for the specific language governing permissions and limitations
11 11
 # under the License.
12 12
 
13
+import mock
14
+
13 15
 import pytest
14 16
 
15 17
 from octane.util import ceph
@@ -35,3 +37,15 @@ def test_get_ceph_conf_filename(mocker, node, cmd_output, conf_file):
35 37
         "octane.util.ssh.call_output", return_value=cmd_output)
36 38
     assert conf_file == ceph.get_ceph_conf_filename(node)
37 39
     mock_ssh.assert_called_once_with(cmd, node=node)
40
+
41
+
42
+def test_restart_radowgw(mocker):
43
+    mock_get = mocker.patch("octane.util.env.get_one_controller")
44
+    mock_call = mocker.patch("octane.util.ssh.call")
45
+    mock_env = mock.Mock()
46
+
47
+    ceph.restart_radosgw(mock_env)
48
+
49
+    mock_get.assert_called_once_with(mock_env)
50
+    mock_call.assert_called_once_with(["service", "radosgw", "restart"],
51
+                                      node=mock_get.return_value)

+ 5
- 0
octane/util/ceph.py View File

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

Loading…
Cancel
Save