Ask Your Question
0

Heat - ERROR: 'NoneType' object has no attribute 'iteritems'

asked 2014-04-26 02:13:53 -0500

senyapsudah gravatar image

i'm having problem to get instance created using heat template. i take the template from the icehouse guide. currently also using icehouse version.

heat_template_version: 2013-05-23
description: Test Template
parameters:
ImageID:
type: string
description: Image use to boot a server
NetID:
type: string
description: Network ID for the server
resources:
server1:
type: OS::Nova::Server
properties:
name: "Test server"
image: { get_param: ImageID }
flavor: "m1.tiny"
networks:
- network: { get_param: NetID }
outputs:
server1_private_ip:
description: IP address of the server in the private network
value: { get_attr: [ server1, first_address ] }

follow the exact command with few adjustment based on my setup.

heat stack-create -f test-stack.yml -P "ImageID=Fedora 19 x86_64;NetID=$NET_ID" testStack

but i end up with:

ERROR: 'NoneType' object has no attribute 'iteritems'

from my heat-engine.log i can see.

template is {u'heat_template_version': u'2013-05-23', u'description': u'IP address of the server in the private network', u'parameters':
 None, u'NetID': None, u'outputs': None, u'image': {u'get_param': u'ImageID'}, u'server1_private_ip': None, u'server1': None, u'value': {u'get_attr': [u'server1', u'first_address']}, u'ImageID': None, u'networks': [{u'network': {u'get_pa
ram': u'NetID'}}], u'flavor': u'm1.tiny', u'type': u'OS::Nova::Server', u'properties': None, u'resources': None, u'name': u'Test server'}
2014-04-26 15:08:09.916 497 ERROR heat.openstack.common.rpc.amqp [req-c0f523ad-c08c-40e1-b632-5d9e66f81f8a None] Exception during message handling
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp Traceback (most recent call last):
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp   File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/amqp.py", line 462, in _process_data
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp     **args)
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp   File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp     result = getattr(proxyobj, method)(ctxt, **kwargs)
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp   File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 63, in wrapped
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp     return func(self, ctx, *args, **kwargs)
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp   File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 510, in create_stack
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp     self._validate_new_stack(cnxt, stack_name, tmpl)
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp   File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 443, in _validate_new_stack
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp     num_resources = len(parsed_template[parsed_template.RESOURCES])
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp   File "/usr/lib/python2.7/dist-packages/heat/engine/hot/template.py", line 74, in __getitem__
2014-04-26 15:08:09.916 497 TRACE heat.openstack.common.rpc.amqp ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-04-26 11:18:49 -0500

Qiming gravatar image

updated 2014-04-26 11:19:53 -0500

Your template is not formatted correctly. When using YAML template, you have to pay attention to the identation of all lines because that is the grammar for YAML.

heat_template_version: 2013-05-23
description: Test Template
parameters:
  ImageID:
    type: string
    description: Image use to boot a server
  NetID:
    type: string
    description: Network ID for the server
resources:
  server1:
    type: OS::Nova::Server
    properties:
      name: "Testserver"
      image: { get_param: ImageID }
      flavor: "m1.tiny"
      networks:
      - network: { get_param: NetID }
outputs:
  server1_private_ip:
    description: IP address of the server in the private network
    value: { get_attr: [ server1, first_address ] }
edit flag offensive delete link more

Comments

thanks for the information. to be frank i did not know much about yaml. i just got to know that there is a specific format to make it work.

senyapsudah gravatar imagesenyapsudah ( 2014-04-27 18:50:31 -0500 )edit

If that was the problem, please mark the question as answered!

SpamapS gravatar imageSpamapS ( 2014-05-06 15:40:08 -0500 )edit

i also face the same issue and answer above solved my problem.

manish gravatar imagemanish ( 2014-05-29 05:15:44 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-04-26 02:13:53 -0500

Seen: 3,923 times

Last updated: Apr 26 '14