if a comma_delimited_list does not have a value or default you can't show the stack

Bug #1424600 reported by Angus Salkeld
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Angus Salkeld

Bug Description

If i have the following parameter (note, no default) and I don't provide a value, I can't show the stack or even list stacks.
  Tags: {type: comma_delimited_list}

client error:
heat stack-list -n
ERROR: The server could not comply with the request since it is either malformed or otherwise incorrect.

engine error:
2015-02-23 21:16:26.025 ERROR oslo_messaging.rpc.dispatcher [-] Exception during message handling: can only join an iterable
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/home/angus/work/heat/heat/engine/service.py", line 75, in wrapped
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher return func(self, ctx, *args, **kwargs)
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/home/angus/work/heat/heat/engine/service.py", line 464, in list_stacks
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher return [api.format_stack(stack) for stack in stacks]
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/home/angus/work/heat/heat/engine/api.py", line 99, in format_stack
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher rpc_api.STACK_PARAMETERS: stack.parameters.map(str),
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/home/angus/work/heat/heat/engine/parameters.py", line 502, in map
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher for n, p in six.iteritems(self.params) if filter_func(p))
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/home/angus/work/heat/heat/engine/parameters.py", line 502, in <genexpr>
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher for n, p in six.iteritems(self.params) if filter_func(p))
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher File "/home/angus/work/heat/heat/engine/parameters.py", line 377, in __str__
                                                                                                                                         2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher return ",".join(self.value())
2015-02-23 21:16:26.025 TRACE oslo_messaging.rpc.dispatcher TypeError: can only join an iterable

Note this is problematic as nested stacks parameter values are not always strictly validated anymore.
This is not a big problem, it's just the way CommaDelimitedList and Json 's value() method are implemented.
They are not done like the base Parameter class does it (raise UserParameterMissing if no value or default)

Angus Salkeld (asalkeld)
Changed in heat:
importance: Undecided → Medium
assignee: nobody → Angus Salkeld (asalkeld)
milestone: none → kilo-3
status: New → Triaged
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/158545

Changed in heat:
status: Triaged → In Progress
Steven Hardy (shardy)
tags: added: juno-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit f6049539859da8f270defcc27e332eb668252fff
Author: Angus Salkeld <email address hidden>
Date: Tue Feb 24 12:23:06 2015 +1000

    Only parse complex types if there is a value

    This tries to bring it inline with the other value() methods.

    Change-Id: Ib749c44127862b054a01ee74b3e1a716f7b637e8
    Closes-bug: 1424600

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-3 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/245368

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (stable/juno)

Change abandoned by Jeremy Stanley (<email address hidden>) on branch: stable/juno
Review: https://review.openstack.org/245368
Reason: I'm abandoning this change in preparation for deleting the stable/juno branch, which is now at end of life.

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.