Pass list of numbers to comma_delimited_list breaks

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

Bug Description

Here is the step to reproduce:

* The template and environment file:

$ cat test.yaml
heat_template_version: 2014-10-16
parameters:
  test:
    type: comma_delimited_list
    default: []
resources:
  random_group:
    type: OS::Heat::ResourceGroup
    properties:
      count: 5
      removal_policies: [{resource_list: {get_param: test}}]
      resource_def:
        type: OS::Heat::RandomString

$ cat local.yaml
parameters:
  test: [0]

* Create a stack succeeded

$ heat stack-create -f test.yaml test
+--------------------------------------+------------+--------------------+---------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+--------------------+---------------------+
| 43124748-b2f8-4522-a1b8-91075d7b1828 | test | CREATE_IN_PROGRESS | 2015-06-20T15:05:14 |

+--------------------------------------+------------+--------------------+---------------------+

$ heat stack-list
+--------------------------------------+------------+-----------------+---------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+-----------------+---------------------+
| 43124748-b2f8-4522-a1b8-91075d7b1828 | test | CREATE_COMPLETE | 2015-06-20T15:05:14 |
+--------------------------------------+------------+-----------------+---------------------+

* Update the stack with list of numbers as parameter accepted, and sub-sequence requests failed.

$ heat stack-update -f test.yaml -e local.yaml test
+--------------------------------------+------------+-----------------+---------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+-----------------+---------------------+
| 43124748-b2f8-4522-a1b8-91075d7b1828 | test | CREATE_COMPLETE | 2015-06-20T15:05:14 |
+--------------------------------------+------------+-----------------+---------------------+

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

* Here is the server trace:

2015-06-20 11:05:47.263 ERROR oslo_messaging.rpc.dispatcher [req-d78a6e4f-dd5f-4f8b-b60f-0b6546ee07e3 None demo] Exception during message handling: sequence item 0: expected string, int found
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-06-20 11:05:47.263 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-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/common/context.py", line 267, in wrapped
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher return func(self, ctx, *args, **kwargs)
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/service.py", line 511, in list_stacks
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher return [api.format_stack(stack) for stack in stacks]
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/api.py", line 120, in format_stack
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher rpc_api.STACK_PARAMETERS: stack.parameters.map(str),
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/parameters.py", line 519, in map
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher for n, p in six.iteritems(self.params) if filter_func(p))
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/parameters.py", line 519, in <genexpr>
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher for n, p in six.iteritems(self.params) if filter_func(p))
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/heat/heat/engine/parameters.py", line 384, in __str__
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher return ",".join(self.value())
2015-06-20 11:05:47.263 TRACE oslo_messaging.rpc.dispatcher TypeError: sequence item 0: expected string, int found

hongbin (hongbin034)
Changed in heat:
assignee: nobody → hongbin (hongbin034)
description: updated
Changed in heat:
status: New → In Progress
Changed in heat:
importance: Undecided → Medium
Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-2 → 5.0.0
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.