Tacker server throws exception when member action contains UPDATE string.

Bug #1676074 reported by Trinath Somanchi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
High
Trinath Somanchi

Bug Description

When an update operation is executed, like,

$> tacker --debug vim-update 2716adb5-8b9b-4d05-b3d7-c1724d2f43cd --name VIM123

Exception will happen by calling this method by a non admin user.

2017-03-25 23:23:38.589 ERROR tacker.api.v1.resource [req-104bc3e8-2435-4d0f-b3d4-733449df46ed demo demo] update failed: No details.
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource Traceback (most recent call last):
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/api/v1/resource.py", line 77, in resource
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource result = method(request=request, **args)
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/api/v1/base.py", line 458, in update
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource orig_obj)
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/policy.py", line 398, in enforce
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource pluralized)
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/policy.py", line 323, in _prepare_check
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource match_rule = _build_match_rule(action, target, pluralized)
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/policy.py", line 167, in _build_match_rule
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource target, action):
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/policy.py", line 93, in _is_attribute_explicitly_set
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource return (attribute_name in target[attributes.ATTRIBUTES_TO_UPDATE] and
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource KeyError: 'attributes_to_update'
2017-03-25 23:23:38.589 TRACE tacker.api.v1.resource

This error is thrown when an non-admin user attempts to update an attribute.

========= Proposed Fix ========

>>> if 'update' in action:
change into
>>> if 'update' in action and attributes.ATTRIBUTES_TO_UPDATE in target:

By doing such change, will solve this problem.

summary: - Tacker server throws exception on UPDATE action.
+ Tacker server throws exception when member action contains UPDATE
+ string.
Changed in tacker:
assignee: nobody → Trinath Somanchi (trinath-somanchi-m)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

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

Changed in tacker:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in tacker:
milestone: none → pike-1
Changed in tacker:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.openstack.org/452416
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=9d9465156e340eba2b8dbeaa79dd7140462a2546
Submitter: Jenkins
Branch: master

commit 9d9465156e340eba2b8dbeaa79dd7140462a2546
Author: Trinath Somanchi <email address hidden>
Date: Sat Apr 1 14:41:16 2017 +0530

    Tacker server throws exception when member action contains UPDATE string.

    When an update operation is executed, like,

    $> tacker --debug vim-update --description "test" VIM0

    Exception will happen by calling this method by a non admin user.

    ...
    tacker.api.v1.resource return (attribute_name in
         target[attributes.ATTRIBUTES_TO_UPDATE] and
    tacker.api.v1.resource KeyError: 'attributes_to_update'
    ...

    Change-Id: I35d5173e9c5c25c7d544e9909da1fbcec931e6b5
    Closes-Bug: #1676074

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 0.8.0

This issue was fixed in the openstack/tacker 0.8.0 release.

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.