From b6f865fa0081b25a9074ef1acccf752ff39b354f Mon Sep 17 00:00:00 2001 From: Jason Dunsmore Date: Thu, 11 Jun 2015 15:01:52 -0500 Subject: [PATCH] Check that env is not None before decrypting After database migration 056, it became possible to have an environment of None. Check that env is not None before looking inside it. Change-Id: Ic498e8e630608886178df83d1e7a503525834573 Closes-Bug: #1464379 --- heat/objects/raw_template.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/heat/objects/raw_template.py b/heat/objects/raw_template.py index af20200726..9cab9691c4 100644 --- a/heat/objects/raw_template.py +++ b/heat/objects/raw_template.py @@ -47,7 +47,8 @@ class RawTemplate( tpl[field] = db_tpl[field] # If any of the parameters were encrypted, then decrypt them - if env_fmt.ENCRYPTED_PARAM_NAMES in tpl.environment: + if (tpl.environment is not None and + env_fmt.ENCRYPTED_PARAM_NAMES in tpl.environment): parameters = tpl.environment[env_fmt.PARAMETERS] encrypted_param_names = tpl.environment[ env_fmt.ENCRYPTED_PARAM_NAMES]