From 861dff75d439255226820564207f768fff299244 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Fri, 22 Jun 2018 16:54:30 +0100 Subject: [PATCH] fw/exec: context: add write_output() Add a convenience method for invoking write_info(), write_state(), and write_result() of run_output. This will make it easier to call it from multiple places. --- wa/framework/execution.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wa/framework/execution.py b/wa/framework/execution.py index c765f592..6f57ae49 100644 --- a/wa/framework/execution.py +++ b/wa/framework/execution.py @@ -132,9 +132,7 @@ class ExecutionContext(object): self.run_output.info.end_time = datetime.utcnow() self.run_output.info.duration = self.run_output.info.end_time -\ self.run_output.info.start_time - self.run_output.write_info() - self.run_output.write_state() - self.run_output.write_result() + self.write_output() def finalize(self): self.tm.finalize() @@ -185,6 +183,11 @@ class ExecutionContext(object): def write_state(self): self.run_output.write_state() + def write_output(self): + self.run_output.write_info() + self.run_output.write_state() + self.run_output.write_result() + def get_resource(self, resource, strict=True): result = self.resolver.get(resource, strict) if result is None: