]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/keystone: pip install bindep
authorCasey Bodley <cbodley@redhat.com>
Thu, 5 Sep 2019 18:06:45 +0000 (14:06 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 13 Sep 2019 19:04:43 +0000 (15:04 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
qa/tasks/keystone.py

index 116a20bf21fb61fdee1c35a3b884645d283ce474..f7f0872e6978fd40f6e03dbaae3866d063b2f5a3 100644 (file)
@@ -26,6 +26,15 @@ def run_in_keystone_dir(ctx, client, args, **kwargs):
         **kwargs
     )
 
+def get_toxvenv_dir(ctx):
+    return ctx.tox.venv_path
+
+def run_in_tox_venv(ctx, remote, args, **kwargs):
+    return remote.run(
+        args=[ 'source', '{}/bin/activate'.format(get_toxvenv_dir(ctx)), run.Raw('&&') ] + args,
+        **kwargs
+    )
+
 def run_in_keystone_venv(ctx, client, args):
     run_in_keystone_dir(ctx, client,
                         [   'source',
@@ -37,9 +46,6 @@ def get_keystone_venved_cmd(ctx, cmd, args):
     kbindir = get_keystone_dir(ctx) + '/.tox/venv/bin/'
     return [ kbindir + 'python', kbindir + cmd ] + args
 
-def get_toxvenv_dir(ctx):
-    return ctx.tox.venv_path
-
 @contextlib.contextmanager
 def download(ctx, config):
     """
@@ -100,10 +106,14 @@ def install_packages(ctx, config):
 
     packages = {}
     for (client, _) in config.items():
+        (remote,) = ctx.cluster.only(client).remotes.iterkeys()
         # use bindep to read which dependencies we need from keystone/bindep.txt
-        r = run_in_keystone_dir(ctx, client, ['bindep', '-c'], stdout=StringIO())
+        run_in_tox_venv(ctx, remote, ['pip', 'install', 'bindep'])
+        r = run_in_tox_venv(ctx, remote,
+                ['bindep', '--brief', '--file', '{}/bindep.txt'.format(get_keystone_dir(ctx))],
+                stdout=StringIO(),
+                check_status=False) # returns 1 on success?
         packages[client] = r.stdout.getvalue().splitlines()
-        (remote,) = ctx.cluster.only(client).remotes.iterkeys()
         for dep in packages[client]:
             install_package(dep, remote)
     try: