added HasId to quark db models
This commit is contained in:
@@ -29,6 +29,8 @@ from quantum.openstack.common import timeutils
|
||||
|
||||
from quark.db import custom_types
|
||||
|
||||
HasId = models.HasId
|
||||
|
||||
LOG = logging.getLogger("quantum.quark.db.models")
|
||||
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ class OptimizedNVPDriver(NVPDriver):
|
||||
return switches
|
||||
|
||||
|
||||
class LSwitchPort(models.BASEV2, models.models.HasId):
|
||||
class LSwitchPort(models.BASEV2, models.HasId):
|
||||
__tablename__ = "quark_nvp_driver_lswitchport"
|
||||
port_id = sa.Column(sa.String(255), nullable=False)
|
||||
switch_id = sa.Column(sa.String(255),
|
||||
@@ -274,7 +274,7 @@ class LSwitchPort(models.BASEV2, models.models.HasId):
|
||||
nullable=False)
|
||||
|
||||
|
||||
class LSwitch(models.BASEV2, models.models.HasId):
|
||||
class LSwitch(models.BASEV2, models.HasId):
|
||||
__tablename__ = "quark_nvp_driver_lswitch"
|
||||
nvp_id = sa.Column(sa.String(255), nullable=False)
|
||||
network_id = sa.Column(sa.String(255), nullable=False)
|
||||
|
||||
@@ -81,10 +81,10 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
|
||||
def __init__(self):
|
||||
# NOTE(jkoelker) Register the event on all models that have ids
|
||||
for _name, klass in inspect.getmembers(models, inspect.isclass):
|
||||
if klass is models.models.HasId:
|
||||
if klass is models.HasId:
|
||||
continue
|
||||
|
||||
if models.models.HasId in klass.mro():
|
||||
if models.HasId in klass.mro():
|
||||
event.listen(klass, "init", perhaps_generate_id)
|
||||
|
||||
quantum_db_api.configure_db()
|
||||
|
||||
Reference in New Issue
Block a user