From 769785dad7a99efc1dc6b87a069e27076eb72f0d Mon Sep 17 00:00:00 2001 From: Vasu Kulkarni Date: Fri, 25 May 2018 18:19:18 -0400 Subject: [PATCH] ship utilities file during ceph-ansible task Signed-off-by: Vasu Kulkarni --- teuthology/task/ceph_ansible.py | 6 ++++++ teuthology/task/install/util.py | 29 ++++++++++++++++------------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/teuthology/task/ceph_ansible.py b/teuthology/task/ceph_ansible.py index 5dcd9bc04c..be01d3e44a 100644 --- a/teuthology/task/ceph_ansible.py +++ b/teuthology/task/ceph_ansible.py @@ -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 = {} diff --git a/teuthology/task/install/util.py b/teuthology/task/install/util.py index 289a79d56a..59547e4422 100644 --- a/teuthology/task/install/util.py +++ b/teuthology/task/install/util.py @@ -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, + ), + ) -- 2.39.5