TypeError error for insecure calls to sqlalchemy db api

Bug #1763068 reported by Kevin Pouget
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Kevin Pouget

Bug Description

Call to `db.v2.sqlalchemy.api._get_collection` function with `insecure=True` and `fields` specified cause a call to `b.model_query(model, *columns)` with erroneous parameters.

Traceback (most recent call last):
  File "mistral/tests/unit/db/v2/test_sqlalchemy_db_api.py", line 3071, in test_get_event_triggers_specific_fields_insecure
  File "mistral/db/sqlalchemy/base.py", line 117, in _within_session
    result = func(*args, **kw)
  File "mistral/db/v2/sqlalchemy/api.py", line 1495, in get_event_triggers
    return _get_collection(model=models.EventTrigger, **kwargs)
  File "mistral/db/v2/sqlalchemy/api.py", line 262, in _get_collection
    query = (b.model_query(model, *columns) if insecure
  File "mistral/db/sqlalchemy/base.py", line 117, in _within_session
    result = func(*args, **kw)
TypeError: model_query() got multiple values for keyword argument 'session'

Kevin Pouget (kpouget)
Changed in mistral:
assignee: nobody → Kevin Pouget (kpouget)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/560478
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=96f1f223e7aefe7f6ee84d7c3199604bb31b2e0a
Submitter: Zuul
Branch: master

commit 96f1f223e7aefe7f6ee84d7c3199604bb31b2e0a
Author: Kevin Pouget <email address hidden>
Date: Wed Apr 11 17:41:11 2018 +0200

    Fix call to model_query in sqlalchemy.api._get_collection

    Fix `columns` parameter in call to `model_query` when
    sqlalchemy.api._get_collection called with insecure to
    true, and specific fields defined.

    Change-Id: Ib46173d42d794775cfa302856cf9703ce8549389
    Closes-Bug: #1763068

Changed in mistral:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral

This issue was fixed in the openstack/mistral development milestone.

Dougal Matthews (d0ugal)
Changed in mistral:
milestone: none → rocky-1
Dougal Matthews (d0ugal)
Changed in mistral:
importance: Undecided → Medium
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.