]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
task/console_log: Allow specifying remotes
authorZack Cerza <zack@redhat.com>
Tue, 28 Nov 2017 17:37:43 +0000 (10:37 -0700)
committerZack Cerza <zack@redhat.com>
Thu, 30 Nov 2017 19:15:42 +0000 (12:15 -0700)
For use with reimaging; allow passing remotes directly instead of
relying on the ctx.cluster object, which won't exist at that time.

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

index c352e7ca92c863458dba8e668abfa45268c1fd04..ab94ed2abb953f72439ebccd87599afda74b90bc 100644 (file)
@@ -22,6 +22,8 @@ class ConsoleLog(Task):
             self.enabled = False
         if 'logfile_name' in self.config:
             self.logfile_name = self.config['logfile_name']
+        if 'remotes' in self.config:
+            self.remotes = self.config['remotes']
 
     def filter_hosts(self):
         super(ConsoleLog, self).filter_hosts()
@@ -40,6 +42,7 @@ class ConsoleLog(Task):
             else:
                 new_cluster.add(remote, roles)
         self.cluster = new_cluster
+        self.remotes = self.cluster.remotes.keys()
         return self.cluster
 
     def setup(self):
@@ -65,7 +68,7 @@ class ConsoleLog(Task):
         self.start_logging()
 
     def start_logging(self):
-        for remote in self.cluster.remotes.keys():
+        for remote in self.remotes:
             log_path = os.path.join(
                 self.archive_dir,
                 self.logfile_name.format(shortname=remote.shortname),