Identity _try_wrapper method is broken for kwargs

Bug #1375415 reported by Priti Desai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Medium
David Kranz

Bug Description

_try_wrapper method in DataGenerator class (https://github.com/openstack/tempest/blob/master/tempest/api/identity/base.py) has typo. It does not pass kwargs as a packed dictionary.

def _try_wrapper(func, item, **kwargs):
            try:
                if kwargs:
                    func(item['id'], kwargs)

func() call should be:

                    func(item['id'], **kwargs)

Without this fix, tempest run fails with:

$ ./run_tempest.sh -d tempest.api.identity.admin.v3.test_list_users

2014-09-29 18:39:27.179 28510 TRACE tempest.api.identity.base File "tempest/api/identity/base.py", line 205, in _try_wrapper
2014-09-29 18:39:27.179 28510 TRACE tempest.api.identity.base func(item['id'], kwargs)
2014-09-29 18:39:27.179 28510 TRACE tempest.api.identity.base TypeError: update_domain() takes exactly 2 arguments (3 given)

With the fix applied on line 205, the tempest run succeeds.

Changed in tempest:
assignee: nobody → Priti Desai (priti-desai)
description: updated
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Nice catch.

Currently exception is being just logged and which leads to resource leakage but tests pass.

Changed in tempest:
status: New → Confirmed
importance: Undecided → High
Changed in tempest:
status: Confirmed → Triaged
importance: High → Medium
Changed in tempest:
assignee: Priti Desai (priti-desai) → David Kranz (david-kranz)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/126417
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=9e2ad374fcdfa308cfe72ea6e5a5d871dd4975d0
Submitter: Jenkins
Branch: master

commit 9e2ad374fcdfa308cfe72ea6e5a5d871dd4975d0
Author: David Kranz <email address hidden>
Date: Mon Oct 6 17:06:20 2014 -0400

    Fix use of kwargs instead of **kwargs

    This but did not show well because it is used inside a handler that
    ignores and logs the exception. But the domain update call fails.

    Closes-Bug: #1375415

    Change-Id: I16f01b6c2b6cc71ad60f42f4c875cbb85d2e016b

Changed in tempest:
status: In Progress → Fix Released
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.