From d9da67e738e90d2842421fe0d5e20311ff18fe70 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Sun, 10 Jul 2016 01:09:02 +0800 Subject: Fix bug in python3.4: 'dict_keys' object does not support indexing In python3.4, dictory's function of key() return value is a dict_key object, not list, so the follow code will be error: dict x = {1:11, 2:22, 3;33} y= x.keys()[0] the error is TypeError: 'dict_keys' object does not support indexing, the correct expression is below: y = list(x.keys())[0] So parser's code will be modified refer to above. Change-Id: I41e0c28167c7823fc735aaf3afc78c1a9a15e9e0 JIRA: PARSER-64 Signed-off-by: shangxdy --- tosca2heat/tosca-parser/toscaparser/tosca_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tosca2heat/tosca-parser/toscaparser/tosca_template.py') diff --git a/tosca2heat/tosca-parser/toscaparser/tosca_template.py b/tosca2heat/tosca-parser/toscaparser/tosca_template.py index 01e6c73..8753a2c 100644 --- a/tosca2heat/tosca-parser/toscaparser/tosca_template.py +++ b/tosca2heat/tosca-parser/toscaparser/tosca_template.py @@ -210,7 +210,7 @@ class ToscaTemplate(object): def _handle_nested_topo_tpls(self, nested_topo_tpls): for tpl in nested_topo_tpls: - filename, tosca_tpl = tpl.items()[0] + filename, tosca_tpl = list(tpl.items())[0] if tosca_tpl.get(TOPOLOGY_TEMPLATE): nested_template = ToscaTemplate( path=filename, parsed_params=self.parsed_params, -- cgit 1.2.3-korg