]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
ship utilities file during ceph-ansible task
authorVasu Kulkarni <vasu@redhat.com>
Fri, 25 May 2018 22:19:18 +0000 (18:19 -0400)
committerVasu Kulkarni <vasu@redhat.com>
Thu, 14 Feb 2019 20:28:12 +0000 (12:28 -0800)
Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
teuthology/task/ceph_ansible.py
teuthology/task/install/util.py

index 5dcd9bc04c33a9752c1de23f69813a7d3cd06500..be01d3e44af474d387a601f35cf6916617577e70 100644 (file)
@@ -137,6 +137,8 @@ class CephAnsible(Task):
         self.ceph_first_mon = ceph_first_mon
         self.ceph_installer = ceph_installer
         self.args = args
+        # ship utilities files
+        self._ship_utilities()
         if self.config.get('rhbuild'):
             self.run_rh_playbook()
         else:
@@ -521,6 +523,10 @@ class CephAnsible(Task):
             ceph_installer.run(args=('cat', 'ceph-ansible/site.yml'))
             ceph_installer.run(args=('cat', 'ceph-ansible/group_vars/all'))
 
+    def _ship_utilities(self):
+        with ship_utilities(self.ctx, {'skipcleanup': True}) as ship_utils:
+            ship_utils
+
     def _fix_roles_map(self):
         ctx = self.ctx
         ctx.managers = {}
index 289a79d56a90a999d866fb235a97603a2dd122ae..59547e44229b6f8339f0873847d54d978a3fe53b 100644 (file)
@@ -62,7 +62,7 @@ def ship_utilities(ctx, config):
     :param ctx: Context
     :param config: Configuration
     """
-    assert config is None
+    log.info(config)
     testdir = teuthology.get_testdir(ctx)
     filenames = []
 
@@ -109,15 +109,18 @@ def ship_utilities(ctx, config):
     try:
         yield
     finally:
-        log.info('Removing shipped files: %s...', ' '.join(filenames))
-        run.wait(
-            ctx.cluster.run(
-                args=[
-                    'sudo',
-                    'rm',
-                    '-f',
-                    '--',
-                ] + list(filenames),
-                wait=False,
-            ),
-        )
+        if config.get("skipcleanup", False):
+            log.info("skipping cleanup of shipped files")
+        else:
+            log.info('Removing shipped files: %s...', ' '.join(filenames))
+            run.wait(
+                ctx.cluster.run(
+                    args=[
+                        'sudo',
+                        'rm',
+                        '-f',
+                        '--',
+                    ] + list(filenames),
+                    wait=False,
+                ),
+            )