]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
pcp: Use a smarter check for archive presence 873/head
authorZack Cerza <zack@redhat.com>
Tue, 7 Jun 2016 15:40:00 +0000 (09:40 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 7 Jun 2016 15:40:00 +0000 (09:40 -0600)
If ctx.archive was set, but to None, we were failing.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/pcp.py

index 0c384b97e047fd1cdbe86af57cf572bc0ebb37d1..6f61311bc79998a086bd6a82612204bca3ba4c98 100644 (file)
@@ -256,7 +256,7 @@ class PCP(Task):
             )
 
     def setup_graphite(self, hosts):
-        if not hasattr(self.ctx, 'archive'):
+        if not getattr(self.ctx, 'archive', None):
             self.use_graphite = False
         if self.use_graphite:
             out_dir = os.path.join(
@@ -275,7 +275,7 @@ class PCP(Task):
             )
 
     def setup_archive(self, hosts):
-        if not hasattr(self.ctx, 'archive'):
+        if not getattr(self.ctx, 'archive', None):
             self.fetch_archives = False
         if self.fetch_archives:
             self.archiver = PCPArchive(