From 9c56e52a26a52993110b0be80908df4899fdd737 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Tue, 16 Feb 2016 17:03:50 +0100 Subject: [PATCH] Strip any whitespace before checking for json In case the template has any whitespace we should strip it before checking if the first character is a "{" to determine that its a json template Change-Id: Ia25444a2fde7019aa9fdf0d782599be78305ae9c Closes-Bug: #1546166 --- heatclient/common/template_format.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/heatclient/common/template_format.py b/heatclient/common/template_format.py index 1636ebb7..9ba4d641 100644 --- a/heatclient/common/template_format.py +++ b/heatclient/common/template_format.py @@ -45,6 +45,8 @@ def parse(tmpl_str): This includes determination of whether the string is using the JSON or YAML format. """ + # strip any whitespace before the check + tmpl_str = tmpl_str.strip() if tmpl_str.startswith('{'): tpl = json.loads(tmpl_str) else: