From: Josh Durgin Date: Mon, 7 Mar 2022 18:47:33 +0000 (+0000) Subject: task/ansible: check for archive before using it X-Git-Tag: 1.2.0~198^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1723%2Fhead;p=teuthology.git task/ansible: check for archive before using it Running a non-scheduled job you may not have archiving configured. Signed-off-by: Josh Durgin --- diff --git a/teuthology/task/ansible.py b/teuthology/task/ansible.py index 17105a884..8b5f57502 100644 --- a/teuthology/task/ansible.py +++ b/teuthology/task/ansible.py @@ -114,8 +114,9 @@ class Ansible(Task): self.generated_inventory = False self.generated_playbook = False self.log = logging.Logger(__name__) - self.log.addHandler(logging.FileHandler( - os.path.join(ctx.archive, "ansible.log"))) + if ctx.archive: + self.log.addHandler(logging.FileHandler( + os.path.join(ctx.archive, "ansible.log"))) def setup(self): super(Ansible, self).setup()