HOT str_replace raises unicode exception when param is None

Bug #1234390 reported by Randall Burt
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Randall Burt

Bug Description

Changes to HOT str_replace in bug #1228640 result in a unicode exception being thrown when a param value is None (as is often the case during the first call to validate and the param references an attribute of another resource). See attached template and trace.

Revision history for this message
Randall Burt (randall-burt) wrote :
Changed in heat:
assignee: nobody → Randall Burt (randall-burt)
Revision history for this message
Randall Burt (randall-burt) wrote :
Download full text (3.3 KiB)

Hrm. Thought I could attach a trace too. Here it is if you're interested:

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 384, in handle_one_response result = self.application(self.environ, start_response) File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__ resp = self.call_func(req, *args, **self.kwargs) File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func return self.func(req, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/heat/common/wsgi.py", line 368, in __call__ response = req.get_response(self.application) File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296, in send application, catch_exc_info=False) File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application app_iter = application(self.environ, start_response) File "/usr/local/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py", line 539, in __call__ return self.app(env, start_response) File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__ resp = self.call_func(req, *args, **self.kwargs) File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func return self.func(req, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/heat/common/wsgi.py", line 368, in __call__ response = req.get_response(self.application) File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296, in send application, catch_exc_info=False) File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application app_iter = application(self.environ, start_response) File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__ return resp(environ, start_response) File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__ response = self.app(environ, start_response) File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__ return resp(environ, start_response) File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__ resp = self.call_func(req, *args, **self.kwargs) File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func return self.func(req, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/heat/common/wsgi.py", line 684, in __call__ raise translate_exception(err, request.best_match_language()) StackValidationFailed_Remote: Property error : node1: user_data coercing to Unicode: need string or buffer, NoneType found Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/amqp.py", line 461, in _process_data **args) File "/usr/lib/python2.7/dist-packages/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch result = getattr(proxyobj, method)(ctxt, **kwargs) File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 60, in wrapped return func(self, ctx, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/heat/engine/service.py", line 273, in create_stack stack.validate() File "/usr/lib/python2.7/dist-packages/heat/engine/parser.py", line 314...

Read more...

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/49443

Changed in heat:
status: New → In Progress
Steven Hardy (shardy)
Changed in heat:
importance: Undecided → High
tags: added: havana-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/49443
Committed: http://github.com/openstack/heat/commit/0becb5f5f58b608b41e8b11d2dbb2da7e3077a5d
Submitter: Jenkins
Branch: master

commit 0becb5f5f58b608b41e8b11d2dbb2da7e3077a5d
Author: Randall Burt <email address hidden>
Date: Tue Oct 1 00:37:54 2013 -0500

    HOT str_replace default to empty string for param

    If a str_replace param cannot be resolved or is None,
    substitute an empty string in order to prevent raising
    an exception during validate.

    Closes Bug: #1234390
    Change-Id: Ica6b84cfc2157b4e1f561f737e9aa67b9f6018ca

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → havana-rc2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/50288

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (milestone-proposed)

Reviewed: https://review.openstack.org/50288
Committed: http://github.com/openstack/heat/commit/1a7edc6a1f660408d87cabf2569953892eb22604
Submitter: Jenkins
Branch: milestone-proposed

commit 1a7edc6a1f660408d87cabf2569953892eb22604
Author: Randall Burt <email address hidden>
Date: Tue Oct 1 00:37:54 2013 -0500

    HOT str_replace default to empty string for param

    If a str_replace param cannot be resolved or is None,
    substitute an empty string in order to prevent raising
    an exception during validate.

    Closes Bug: #1234390
    Change-Id: Ica6b84cfc2157b4e1f561f737e9aa67b9f6018ca

Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: havana-rc2 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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