]> git-server-git.apps.pok.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>
Mon, 30 Jul 2018 23:12:48 +0000 (16:12 -0700)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/cephfs/mount.py
qa/tasks/cephfs/test_volume_client.py
qa/tasks/vstart_runner.py

index 16b2149a819cc86c6a862d895fdf7e86cf72ffe5..bcc9aefd89543420a2571260d87c6f59f4c89dac 100644 (file)
@@ -144,13 +144,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 cf135bce12295c20addd6634038f0755c9765e5f..3203bac9572377481fe21b50ad48a1573ec39d32 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 cad41d42f29fd6305acfe75797fd6a1bdcdab2a1..1393e358e4ec13a60448c591de9d37ad1fac78bf 100644 (file)
@@ -540,15 +540,13 @@ class LocalFuseMount(FuseMount):
 
         self.gather_mount_info()
 
-    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):