summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2016-08-16 19:48:25 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2016-08-16 19:48:25 +0800
commitb98b5e075c7287317b1620746cc83e1af8b6243e (patch)
treedaedfa571d430a86adee0a1c5be53f591f2c42e6
parentde4f5e5c4ee8923c8a441c093fb12ddd9fe6fed5 (diff)
Fix parser test bug with functest in real env.
Traceback (most recent call last): File "/usr/local/bin/heat-translator", line 10, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/translator/shell.py", line 225, in main TranslatorShell().main(args) File "/usr/local/lib/python2.7/dist-packages/translator/shell.py", line 121, in main parsed_params, a_file, deploy) File "/usr/local/lib/python2.7/dist-packages/translator/shell.py", line 168, in _translate output = translator.translate() File "/usr/local/lib/python2.7/dist-packages/translator/hot/tosca_translator.py", line 42, in translate self.hot_template.resources = self.node_translator.translate() File "/usr/local/lib/python2.7/dist-packages/translator/hot/translate_node_templates.py", line 159, in translate return self._translate_nodetemplates() File "/usr/local/lib/python2.7/dist-packages/translator/hot/translate_node_templates.py", line 302, in _translate_nodetemplates self._recursive_handle_properties(resource) File "/usr/local/lib/python2.7/dist-packages/translator/hot/translate_node_templates.py", line 173, in _recursive_handle_properties resource.handle_properties() File "/usr/local/lib/python2.7/dist-packages/translator/hot/tosca/tosca_compute.py", line 105, in handle_properties self.nodetemplate.get_capability('os')) File "/usr/local/lib/python2.7/dist-packages/translator/hot/tosca/tosca_compute.py", line 134, in translate_compute_flavor_and_image image = self._best_image(os_cap_props) File "/usr/local/lib/python2.7/dist-packages/translator/hot/tosca/tosca_compute.py", line 266, in _best_image if len(resp.keys()) > 0: AttributeError: 'NoneType' object has no attribute 'keys' Traceback (most recent call last): File "/usr/local/bin/heat-translator", line 10, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/translator/shell.py", line 225, in main TranslatorShell().main(args) File "/usr/local/lib/python2.7/dist-packages/translator/shell.py", line 121, in main parsed_params, a_file, deploy) File "/usr/local/lib/python2.7/dist-packages/translator/shell.py", line 168, in _translate output = translator.translate() File "/usr/local/lib/python2.7/dist-packages/translator/hot/tosca_translator.py", line 42, in translate self.hot_template.resources = self.node_translator.translate() File "/usr/local/lib/python2.7/dist-packages/translator/hot/translate_node_templates.py", line 159, in translate return self._translate_nodetemplates() File "/usr/local/lib/python2.7/dist-packages/translator/hot/translate_node_templates.py", line 302, in _translate_nodetemplates self._recursive_handle_properties(resource) File "/usr/local/lib/python2.7/dist-packages/translator/hot/translate_node_templates.py", line 173, in _recursive_handle_properties resource.handle_properties() File "/usr/local/lib/python2.7/dist-packages/translator/hot/tosca/tosca_compute.py", line 105, in handle_properties self.nodetemplate.get_capability('os')) File "/usr/local/lib/python2.7/dist-packages/translator/hot/tosca/tosca_compute.py", line 134, in translate_compute_flavor_and_image image = self._best_image(os_cap_props) File "/usr/local/lib/python2.7/dist-packages/translator/hot/tosca/tosca_compute.py", line 266, in _best_image if len(resp.keys()) > 0: AttributeError: 'NoneType' object has no attribute 'keys' The request you have made requires authentication. (HTTP 401) (Request-ID: req-027940ce-5a5f-4459-9d91-7e65329c4d13) The request you have made requires authentication. (HTTP 401) (Request-ID: req-32c378fb-6d3c-46c6-845e-a8dd50975acd) JIRA:PARSER-89 Change-Id: Id89d2293972cae9f39c0d950fc67fdc6ae520304 Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
-rw-r--r--tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py b/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py
index b8ad83c..45637ec 100644
--- a/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py
+++ b/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py
@@ -263,7 +263,7 @@ class ToscaCompute(HotResource):
images = IMAGES
if translator.common.utils.check_for_env_variables():
resp = self._populate_image_dict()
- if len(resp.keys()) > 0:
+ if resp and len(resp.keys()) > 0:
images = resp
match_all = images.keys()
architecture = properties.get(self.ARCHITECTURE)