← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1550618] Re: sqlalchemy column replacement warnings on rbac tables

 

Reviewed:  https://review.openstack.org/285607
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=35e234db9064d334f4ce99f6a40ace042c970f35
Submitter: Jenkins
Branch:    master

commit 35e234db9064d334f4ce99f6a40ace042c970f35
Author: Kevin Benton <kevin@xxxxxxxxxx>
Date:   Wed Feb 24 15:15:13 2016 -0800

    Make __table_args__ declarative in RBACColumns
    
    The UniqueConstraint being constructed at class load time for
    RBACColumns meant that all tables inheriting from it ended up
    sharing the same UniqueConstraint object. This led to a bunch
    of warnings about columns being replaced from one table to
    another. This didn't appear to affect any functionality but it
    may have broken queries across both tables.
    
    This patch just converts it into a declared attr so a separate
    constraint object gets created for each table that inherits the
    class.
    
    Closes-Bug: #1550618
    Change-Id: I02b8e911125c06691bf02b6e7ac02cf25c4c4142


** Changed in: neutron
       Status: In Progress => Fix Released

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

Title:
  sqlalchemy column replacement warnings on rbac tables

Status in neutron:
  Fix Released

Bug description:

  We are now getting the following warnings after the QoS RBAC patch
  merged:

  /opt/stack/neutron/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/base.py:526: SAWarning: Column 'target_tenant' on table Table('networkrbacs', MetaData(bind=None), Column('tenant_id', String(length=255), table=<networkrbacs>), Column('id', String(length=36), table=<networkrbacs>, primary_key=True, nullable=False, default=ColumnDefault(<function <lambda> at 0x7fa3bebe7b90>)), Column('target_tenant', String(length=255), table=<networkrbacs>, nullable=False), Column('action', String(length=255), table=<networkrbacs>, nullable=False), Column('object_id', String(length=36), ForeignKey('networks.id'), table=<networkrbacs>, nullable=False), schema=None) being replaced by Column('target_tenant', String(length=255), table=<qospolicyrbacs>, nullable=False), which has the same key.  Consider use_labels for select() statements.
    (key, getattr(existing, 'table', None), value))
  /opt/stack/neutron/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/base.py:526: SAWarning: Column 'object_id' on table Table('networkrbacs', MetaData(bind=None), Column('tenant_id', String(length=255), table=<networkrbacs>), Column('id', String(length=36), table=<networkrbacs>, primary_key=True, nullable=False, default=ColumnDefault(<function <lambda> at 0x7fa3bebe7b90>)), Column('target_tenant', String(length=255), table=<networkrbacs>, nullable=False), Column('action', String(length=255), table=<networkrbacs>, nullable=False), Column('object_id', String(length=36), ForeignKey('networks.id'), table=<networkrbacs>, nullable=False), schema=None) being replaced by Column('object_id', String(length=36), ForeignKey('qos_policies.id'), table=<qospolicyrbacs>, nullable=False), which has the same key.  Consider use_labels for select() statements.
    (key, getattr(existing, 'table', None), value))
  /opt/stack/neutron/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/base.py:526: SAWarning: Column 'action' on table Table('networkrbacs', MetaData(bind=None), Column('tenant_id', String(length=255), table=<networkrbacs>), Column('id', String(length=36), table=<networkrbacs>, primary_key=True, nullable=False, default=ColumnDefault(<function <lambda> at 0x7fa3bebe7b90>)), Column('target_tenant', String(length=255), table=<networkrbacs>, nullable=False), Column('action', String(length=255), table=<networkrbacs>, nullable=False), Column('object_id', String(length=36), ForeignKey('networks.id'), table=<networkrbacs>, nullable=False), schema=None) being replaced by Column('action', String(length=255), table=<qospolicyrbacs>, nullable=False), which has the same key.  Consider use_labels for select() statements.
    (key, getattr(existing, 'table', None), value))

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


References