yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #25632
[Bug 1398470] Re: sql migration helpers incorrectly inspect for FKs
** Changed in: keystone
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1398470
Title:
sql migration helpers incorrectly inspect for FKs
Status in OpenStack Identity (Keystone):
Fix Released
Bug description:
Our sql migration tests utilise the migration_helpers to execute such
things as adding and removing constraints. In the case of ForeignKeys,
the remove helper uses a method like this:
def get_constraints_names(table, column_name):
fkeys = [fk.name for fk in table.constraints
if (column_name in fk.columns and
isinstance(fk, sqlalchemy.ForeignKeyConstraint)]
return keys
The test for column name in fk_colums is unsafe as written, since
there are more than just ForeignKeyContraints in table.constraints
(and they don't all have a columns attribute). The check should first
ensure the item we are looking at IS a ForeignKey, and then check the
column.
To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1398470/+subscriptions
References