]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/ceph-volume: allow executing python pyloads using python3
authorRishabh Dave <ridave@redhat.com>
Tue, 24 Jul 2018 07:59:55 +0000 (07:59 +0000)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 27 Sep 2018 23:25:17 +0000 (16:25 -0700)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 2f35ade05f9910ef9bdaaa24de9593bd584073fa)

Conflicts:
qa/tasks/vstart_runner.py

qa/tasks/cephfs/mount.py
qa/tasks/cephfs/test_volume_client.py
qa/tasks/vstart_runner.py

index 4f96e6cdc21742c70ebb1450c37e8148354f5fb6..8a76d09faa1d4b5543fd0f2d1914f25a0290f2ad 100644 (file)
@@ -124,13 +124,14 @@ class CephFSMount(object):
             'sudo', 'rm', '-f', os.path.join(self.mountpoint, filename)
         ])
 
-    def _run_python(self, pyscript):
-        return self.client_remote.run(args=[
-            'sudo', 'adjust-ulimits', 'daemon-helper', 'kill', 'python', '-c', pyscript
-        ], wait=False, stdin=run.PIPE, stdout=StringIO())
-
-    def run_python(self, pyscript):
-        p = self._run_python(pyscript)
+    def _run_python(self, pyscript, py_version='python'):
+        return self.client_remote.run(
+               args=['sudo', 'adjust-ulimits', 'daemon-helper', 'kill',
+                     py_version, '-c', pyscript], wait=False, stdin=run.PIPE,
+               stdout=StringIO())
+
+    def run_python(self, pyscript, py_version='python'):
+        p = self._run_python(pyscript, py_version)
         p.wait()
         return p.stdout.getvalue().strip()
 
index 9be7fc2fff5575dced0f2e722ab0bacbf9629d99..2e0bf6751e346727d9ab5dabda920d6b71d30fe7 100644 (file)
@@ -14,6 +14,7 @@ class TestVolumeClient(CephFSTestCase):
     # One for looking at the global filesystem, one for being
     # the VolumeClient, two for mounting the created shares
     CLIENTS_REQUIRED = 4
+    py_version = 'python'
 
     def _volume_client_python(self, client, script, vol_prefix=None, ns_prefix=None):
         # Can't dedent this *and* the script we pass in, because they might have different
@@ -32,7 +33,9 @@ vc = CephFSVolumeClient("manila", "{conf_path}", "ceph", {vol_prefix}, {ns_prefi
 vc.connect()
 {payload}
 vc.disconnect()
-        """.format(payload=script, conf_path=client.config_path, vol_prefix=vol_prefix, ns_prefix=ns_prefix))
+        """.format(payload=script, conf_path=client.config_path,
+                   vol_prefix=vol_prefix, ns_prefix=ns_prefix),
+        self.py_version)
 
     def _sudo_write_file(self, remote, path, data):
         """
index e7f7f68f34570557db146eb87d7b6b63d3e15748..91afb7d0f7bf64114c2ee2096f5a93c64f87dc40 100644 (file)
@@ -516,15 +516,13 @@ class LocalFuseMount(FuseMount):
         else:
             self._fuse_conn = new_conns[0]
 
-    def _run_python(self, pyscript):
+    def _run_python(self, pyscript, py_version='python'):
         """
         Override this to remove the daemon-helper prefix that is used otherwise
         to make the process killable.
         """
-        return self.client_remote.run(args=[
-            'python', '-c', pyscript
-        ], wait=False)
-
+        return self.client_remote.run(args=[py_version, '-c', pyscript],
+                                      wait=False)
 
 class LocalCephManager(CephManager):
     def __init__(self):