]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix RBAC filter query for negative case
authorKevin Benton <blak111@gmail.com>
Sat, 5 Sep 2015 01:27:42 +0000 (18:27 -0700)
committerKevin Benton <blak111@gmail.com>
Sat, 5 Sep 2015 01:27:42 +0000 (18:27 -0700)
commitad9aaa63e5ea427d24c07e6a36a2976d83f1a26f
tree1d027cc61ad6c2845cb36b3e2c5a06b7944e9214
parent710ab239e404a3ef138b7dd796d028ad375060e8
Fix RBAC filter query for negative case

The query to find networks that aren't shared to the querier was
broken. It was querying for the inverse of RBAC entries that shared
to the querier, so it would return the network for each other tenant
it was shared to. This meant that if a network had multiple RBAC
entries, a shared=False filter wouldn't work in the API.

This patch corrects the behavior by adjusting the query that looks
for objects not shared to the caller to make sure the object ID doesn't
appear in the shared subquery.

This patch also adds a test that reliably reproduces the original issue.
The sporadically failing filter test that revealed this issue depended
on a race to have a network be shared to another tenant and to the wildcard
at the same time.

Change-Id: I9dcd869c1640b223221ba12e97284bbfcabbeb2b
Closes-Bug: #1495040
neutron/db/common_db_mixin.py
neutron/tests/api/admin/test_shared_network_extension.py