← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1542815] [NEW] rbac-list response will report wrong object_type

 

Public bug reported:

This will happen when a new rbac table shall be introduced. The cause is the usage of the CommonDbMixin._union_model_query(). The current code flow joins  SQL SELECT results from several rbac tables (per rbac object type). However, the resulting sqlalchemy union list from several  tables contains the db_model type of the first table plus the output rows from all the other tables, causing the REST response of 'rbac-list' to contain the wrong object type. 
E.g: rbac-list on the following db_schema:

networkrbacs table: {id=ID1, target_tenant=ID2, object_id=ID3, ...}
qospolicyrbacs table: empty

will result in REST response:
{"target_tenant": ID2, "object_type": "qos_policy", "object_id": ID3}

The issue hasn't appeared yeat, since there's only a single rbac type
(network) at the moment.

** Affects: neutron
     Importance: Undecided
     Assignee: Haim Daniel (hdaniel)
         Status: New

** Changed in: neutron
     Assignee: (unassigned) => Haim Daniel (hdaniel)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1542815

Title:
  rbac-list response will report  wrong object_type

Status in neutron:
  New

Bug description:
  This will happen when a new rbac table shall be introduced. The cause is the usage of the CommonDbMixin._union_model_query(). The current code flow joins  SQL SELECT results from several rbac tables (per rbac object type). However, the resulting sqlalchemy union list from several  tables contains the db_model type of the first table plus the output rows from all the other tables, causing the REST response of 'rbac-list' to contain the wrong object type. 
  E.g: rbac-list on the following db_schema:

  networkrbacs table: {id=ID1, target_tenant=ID2, object_id=ID3, ...}
  qospolicyrbacs table: empty

  will result in REST response:
  {"target_tenant": ID2, "object_type": "qos_policy", "object_id": ID3}

  The issue hasn't appeared yeat, since there's only a single rbac type
  (network) at the moment.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1542815/+subscriptions


Follow ups