]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
task/ansible: check for archive before using it 1723/head
authorJosh Durgin <jdurgin@redhat.com>
Mon, 7 Mar 2022 18:47:33 +0000 (18:47 +0000)
committerJosh Durgin <jdurgin@redhat.com>
Fri, 11 Mar 2022 01:48:41 +0000 (01:48 +0000)
Running a non-scheduled job you may not have archiving configured.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
teuthology/task/ansible.py

index 17105a88490a7c90fb51fc66352eb77844fda1b6..8b5f575027bbbaf649f6b2dd7d7fe2d49cd92730 100644 (file)
@@ -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()