]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks: s/virtualenv/python3 -m venv/
authorKefu Chai <kchai@redhat.com>
Sat, 31 Jul 2021 13:06:23 +0000 (21:06 +0800)
committerKen Dreyer <kdreyer@redhat.com>
Tue, 31 Aug 2021 21:25:20 +0000 (17:25 -0400)
so we don't need to use virtualenv python package for creating a
virtualenv, the "venv" module in Python3 would suffice.

see also https://docs.python.org/3/library/venv.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit f0ed7a188facb9bb5098c2452fb4d3d134d2c436)

qa/tasks/barbican.py
qa/tasks/cram.py
qa/tasks/pykmip.py
qa/tasks/s3a_hadoop.py
qa/tasks/tox.py

index cfa85e1ddd6ea9236915ed9813ed458b9b753c81..4d1354903df823a50d7cb1270c029d4c502ccf95 100644 (file)
@@ -96,8 +96,11 @@ def setup_venv(ctx, config):
     assert isinstance(config, dict)
     log.info('Setting up virtualenv for barbican...')
     for (client, _) in config.items():
-        run_in_barbican_dir(ctx, client, ['virtualenv', '.barbicanenv'])
-        run_in_barbican_venv(ctx, client, ['pip', 'install', 'pytz', '-e', get_barbican_dir(ctx)])
+        run_in_barbican_dir(ctx, client,
+                            ['python3', '-m', 'venv', '.barbicanenv'])
+        run_in_barbican_venv(ctx, client,
+                             ['pip', 'install', 'pytz',
+                              '-e', get_barbican_dir(ctx)])
     yield
 
 def assign_ports(ctx, config, initial_port):
index fd17f4832b71aaff01ac7393ec7ac6251f4bfe0b..a445a146fe2e02ea28b9a36bec28e0c0cd27c682 100644 (file)
@@ -71,7 +71,7 @@ def task(ctx, config):
                 args=[
                     'mkdir', '--', client_dir,
                     run.Raw('&&'),
-                    'virtualenv', '{tdir}/virtualenv'.format(tdir=testdir),
+                    'python3', '-m', 'venv', '{tdir}/virtualenv'.format(tdir=testdir),
                     run.Raw('&&'),
                     '{tdir}/virtualenv/bin/pip'.format(tdir=testdir),
                     'install', 'cram==0.6',
index d0b72f69ecc0a5bd4e86c3aa5e500a2de3772e6b..3491babc517cc2ccb06626f9c70f808761bb0be2 100644 (file)
@@ -147,7 +147,7 @@ def setup_venv(ctx, config):
     assert isinstance(config, dict)
     log.info('Setting up virtualenv for pykmip...')
     for (client, _) in config.items():
-        run_in_pykmip_dir(ctx, client, ['virtualenv', '.pykmipenv'])
+        run_in_pykmip_dir(ctx, client, ['python3', '-m', 'venv', '.pykmipenv'])
         run_in_pykmip_venv(ctx, client, ['pip', 'install', 'pytz', '-e', get_pykmip_dir(ctx)])
     yield
 
index f06c9acfe9d5981fe9ab9ec96c5fc5e930020d93..cfccf65e3b9e559406d6ca0db00963e006ac6fee 100644 (file)
@@ -144,7 +144,9 @@ def setup_user_bucket(client, dns_name, access_key, secret_key, bucket_name, tes
     )
     client.run(
         args=[
-            'virtualenv',
+            'python3',
+            '-m',
+            'venv',
             '{testdir}/venv'.format(testdir=testdir),
             run.Raw('&&'),
             run.Raw('{testdir}/venv/bin/pip'.format(testdir=testdir)),
index 36c226d0b2e6e4555e6347fa1ce3db645bbc7c2d..61c5b7411b45df32f40d5254a7a629fb9af322e4 100644 (file)
@@ -29,14 +29,14 @@ def task(ctx, config):
     log.info('Deploying tox from pip...')
     for (client, _) in config.items():
         # yup, we have to deploy tox first. The packaged one, available
-       # on Sepia's Ubuntu machines, is outdated for Keystone/Tempest.
+        # on Sepia's Ubuntu machines, is outdated for Keystone/Tempest.
         tvdir = get_toxvenv_dir(ctx)
-        ctx.cluster.only(client).run(args=[ 'virtualenv', '-p', 'python3', tvdir ])
-        ctx.cluster.only(client).run(args=
-            [   'source', '{tvdir}/bin/activate'.format(tvdir=tvdir),
-                run.Raw('&&'),
-                'pip', 'install', 'tox==3.15.0'
-            ])
+        ctx.cluster.only(client).run(args=['python3', '-m', 'venv', tvdir])
+        ctx.cluster.only(client).run(args=[
+            'source', '{tvdir}/bin/activate'.format(tvdir=tvdir),
+            run.Raw('&&'),
+            'pip', 'install', 'tox==3.15.0'
+        ])
 
     # export the path Keystone and Tempest
     ctx.tox = argparse.Namespace()