From e479b5714afebc65e12417f9c6f1196716238f63 Mon Sep 17 00:00:00 2001 From: Cedric Brandily Date: Fri, 7 Nov 2014 21:23:01 +0100 Subject: [PATCH] Correct heat/stack_data template print Currently flame returns: ### Heat Template ### ... heat template ... None ### Stack Data ### ... heat template ... None Because TemplateGenerator.heat_template/stack_data_template print templates and return None instead of returning templates. This change corrects previous methods to output: ### Heat Template ### ... heat template ... ### Stack Data ### ... heat template ... Change-Id: I9f9ad3e859beba583c9db4a0420ec2dd9c3bc8c9 --- flameclient/flame.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flameclient/flame.py b/flameclient/flame.py index b902f00..9cc738b 100644 --- a/flameclient/flame.py +++ b/flameclient/flame.py @@ -111,8 +111,8 @@ class TemplateGenerator(object): for index, element in enumerate(data)) @staticmethod - def print_generated(filename): - print(yaml.safe_dump(filename, default_flow_style=False)) + def format_template(filename): + return yaml.safe_dump(filename, default_flow_style=False) def add_resource(self, name, status, resource_id, resource_type): resource = { @@ -606,7 +606,7 @@ class TemplateGenerator(object): self._extract_volumes() def heat_template(self): - return self.print_generated(self.template) + return self.format_template(self.template) def stack_data_template(self): - return self.print_generated(self.stack_data) + return self.format_template(self.stack_data)