]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph_manager: fix chmod on log dir during pg export copy 32943/head
authorSage Weil <sage@redhat.com>
Tue, 28 Jan 2020 19:54:18 +0000 (13:54 -0600)
committerSage Weil <sage@redhat.com>
Tue, 28 Jan 2020 19:54:18 +0000 (13:54 -0600)
With cephadm, we should chmod both /var/log/ceph and /var/log/ceph/$fsid.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/ceph_manager.py

index 8441506c9599811897d2dca9a32e358b37b95b40..0832265252b921f90750a6ca0e72ff00869c4000 100644 (file)
@@ -319,8 +319,15 @@ class OSDThrasher(Thrasher):
                     "exp.{pg}.{id}".format(
                         pg=pg,
                         id=exp_osd))
+                exp_host_path_dirs = [
+                    os.path.join(
+                        '/var/log/ceph',
+                        self.ceph_manager.ctx.ceph[self.ceph_manager.cluster].fsid),
+                    '/var/log/ceph',
+                ]
             else:
                 exp_host_path = exp_path
+                exp_host_path_dirs = ['/var/log/ceph']
 
             # export
             # Can't use new export-remove op since this is part of upgrade testing
@@ -375,8 +382,9 @@ class OSDThrasher(Thrasher):
                         self.log("Transfer export file from {srem} to {trem}".
                                  format(srem=exp_remote, trem=imp_remote))
                         # just in case an upgrade make /var/log/ceph unreadable by non-root,
-                        exp_remote.run(args=['sudo', 'chmod', '777', '/var/log/ceph'])
-                        imp_remote.run(args=['sudo', 'chmod', '777', '/var/log/ceph'])
+                        for d in exp_host_path_dirs:
+                            exp_remote.run(args=['sudo', 'chmod', '777', d])
+                            imp_remote.run(args=['sudo', 'chmod', '777', d])
                         tmpexport = Remote.get_file(exp_remote, exp_host_path)
                         Remote.put_file(imp_remote, tmpexport, exp_host_path)
                         os.remove(tmpexport)