From: Vasu Kulkarni Date: Fri, 25 May 2018 22:19:18 +0000 (-0400) Subject: ship utilities file during ceph-ansible task X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f704b1fb2caf34bd8931c9caa069830af4619ea;p=teuthology.git ship utilities file during ceph-ansible task Signed-off-by: Vasu Kulkarni --- diff --git a/teuthology/task/ceph_ansible.py b/teuthology/task/ceph_ansible.py index 5dcd9bc04..be01d3e44 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 289a79d56..59547e442 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, + ), + )