Traceback instead of error message when stack_name's format is wrong

Bug #1397313 reported by Peter Razumovsky
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Peter Razumovsky
Juno
Fix Released
Undecided
Sergey Kraynev

Bug Description

1. $ heat stack-create 1test -f templates/stub.yaml
ERROR: Invalid stack name 1stub must contain only alphanumeric or "_-." characters, must start with alpha
Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 137, in _dispatch_and_reply
    incoming.message))

  File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 180, in _dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)

  File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 126, in _do_dispatch
    result = getattr(endpoint, method)(ctxt, **new_args)

  File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)

  File "/opt/stack/heat/heat/engine/service.py", line 72, in wrapped
    return func(self, ctx, *args, **kwargs)

  File "/opt/stack/heat/heat/engine/service.py", line 675, in create_stack
    nested_depth)

  File "/opt/stack/heat/heat/engine/service.py", line 592, in _parse_template_and_validate_stack
    **common_params)

  File "/opt/stack/heat/heat/engine/stack.py", line 95, in __init__
    ) % stack_name)

ValueError: Invalid stack name 1stub must contain only alphanumeric or "_-." characters, must start with alpha

This is wrong, I think response should looks like:
ERROR: Invalid stack name 1test must contain only alphanumeric or "_-." characters, must start with alpha

The same situation with resources. If resource names like "Res/ource", we get traceback instead of error message.

Changed in heat:
assignee: nobody → Razumovsky Peter (prazumovsky)
description: updated
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/137784

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/137784
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=9c877f3172fca65619b1b50bd327b30541cdc439
Submitter: Jenkins
Branch: master

commit 9c877f3172fca65619b1b50bd327b30541cdc439
Author: Peter Razumovsky <email address hidden>
Date: Fri Nov 28 16:18:51 2014 +0300

    Fix error msg invalid stack or res name

    If template contains resource with name like
    'res/name', we will get traceback instead of
    correct error message. The same situation with
    stack name: if it's incorrect, we will get
    traceback.

    Change-Id: I4a0e51ff649aaaad5f18f52383dab186dab54230
    Closes-bug: #1397313

Changed in heat:
status: In Progress → Fix Committed
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/142093

Thierry Carrez (ttx)
Changed in heat:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/juno)

Reviewed: https://review.openstack.org/142093
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=bbf71825604b6d165e1d97fc875ed01f5d6a1cc8
Submitter: Jenkins
Branch: stable/juno

commit bbf71825604b6d165e1d97fc875ed01f5d6a1cc8
Author: Peter Razumovsky <email address hidden>
Date: Fri Nov 28 16:18:51 2014 +0300

    Fix error msg invalid stack or res name

    If template contains resource with name like
    'res/name', we will get traceback instead of
    correct error message. The same situation with
    stack name: if it's incorrect, we will get
    traceback.

    Change-Id: I4a0e51ff649aaaad5f18f52383dab186dab54230
    Closes-bug: #1397313
    (cherry picked from commit 9c877f3172fca65619b1b50bd327b30541cdc439)

Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-1 → 2015.1.0
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.