Create SDGroup with no props raises error with traceback

Bug #1585952 reported by Peter Razumovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Peter Razumovsky

Bug Description

When I create OS::Heat::SoftwareDeploymentGroup with no properties, heat raises error with next traceback:

2016-05-26 12:06:47.899 ERROR heat.engine.stack [req-2cd6a092-7c2c-4d23-ab2e-76dc2c78c0ec None demo] Exception: object of type 'NoneType' has no len()
2016-05-26 12:06:47.899 TRACE heat.engine.stack Traceback (most recent call last):
2016-05-26 12:06:47.899 TRACE heat.engine.stack File "/opt/stack/heat/heat/engine/stack.py", line 759, in validate
2016-05-26 12:06:47.899 TRACE heat.engine.stack result = res.validate()
2016-05-26 12:06:47.899 TRACE heat.engine.stack File "/opt/stack/heat/heat/engine/resources/stack_resource.py", line 63, in validate
2016-05-26 12:06:47.899 TRACE heat.engine.stack self.validate_nested_stack()
2016-05-26 12:06:47.899 TRACE heat.engine.stack File "/opt/stack/heat/heat/engine/resources/openstack/heat/resource_group.py", line 267, in validate_nested_stack
2016-05-26 12:06:47.899 TRACE heat.engine.stack if not self.get_size():
2016-05-26 12:06:47.899 TRACE heat.engine.stack File "/opt/stack/heat/heat/engine/resources/openstack/heat/software_deployment.py", line 634, in get_size
2016-05-26 12:06:47.899 TRACE heat.engine.stack return len(self.properties.get(self.SERVERS, {}))
2016-05-26 12:06:47.899 TRACE heat.engine.stack TypeError: object of type 'NoneType' has no len()
2016-05-26 12:06:47.899 TRACE heat.engine.stack
2016-05-26 12:06:47.922 DEBUG oslo_messaging.rpc.server [req-2cd6a092-7c2c-4d23-ab2e-76dc2c78c0ec None demo] Expected exception during message handling (object of type 'NoneType' has no len()) from (pid=30
248) _process_incoming /usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py:136
2016-05-26 12:06:47.924 ERROR oslo_messaging._drivers.common [req-2cd6a092-7c2c-4d23-ab2e-76dc2c78c0ec None demo] Returning exception object of type 'NoneType' has no len() to caller
2016-05-26 12:06:47.924 ERROR oslo_messaging._drivers.common [req-2cd6a092-7c2c-4d23-ab2e-76dc2c78c0ec None demo] ['Traceback (most recent call last):\n', ' File "/opt/stack/heat/heat/common/context.py",
line 329, in wrapped\n return func(self, ctx, *args, **kwargs)\n', ' File "/opt/stack/heat/heat/engine/service.py", line 973, in update_stack\n cnxt, current_stack, template, params, files, args, te
mplate_id)\n', ' File "/opt/stack/heat/heat/engine/service.py", line 928, in _prepare_stack_updates\n updated_stack.validate()\n', ' File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py
", line 147, in wrapper\n return f(*args, **kwargs)\n', ' File "/opt/stack/heat/heat/engine/stack.py", line 773, in validate\n message=encodeutils.safe_decode(six.text_type(ex)))\n', "StackValidatio
nFailed: object of type 'NoneType' has no len()\n"]

Template
--------

heat_template_version: 2016-10-14
resources:
  test:
    type: OS::Heat::SoftwareDeploymentGroup

Changed in heat:
importance: Undecided → Medium
assignee: nobody → Peter Razumovsky (prazumovsky)
milestone: none → newton-1
Rabi Mishra (rabi)
Changed in heat:
milestone: newton-1 → newton-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/327006

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/327006
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=50b11822548116e64aad2cc26c87ef4306e49dbf
Submitter: Jenkins
Branch: master

commit 50b11822548116e64aad2cc26c87ef4306e49dbf
Author: Peter Razumovsky <email address hidden>
Date: Wed Jun 8 14:10:33 2016 +0300

    Fix creating SDGroup with no properties

    When SDGroup has no properties, it fails with
    impossibility of getting servers properties, so
    need to add servers as required property. No test
    needed in case of known behaviour of properties with
    required option.

    Change-Id: Ib5b867a48b37130b0ef3ad6e21730abe5a5033a9
    Closes-bug: #1585952

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/heat 7.0.0.0b2

This issue was fixed in the openstack/heat 7.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.