From 7c2d4ec8ab989fd4679934ebfce9893e42094669 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Mon, 7 Mar 2022 18:47:33 +0000 Subject: [PATCH] task/ansible: check for archive before using it Running a non-scheduled job you may not have archiving configured. Signed-off-by: Josh Durgin --- teuthology/task/ansible.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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() -- 2.47.3