equal
deleted
inserted
replaced
214 BASEV2 = declarative.declarative_base(cls=model_base.NeutronBaseV2) |
214 BASEV2 = declarative.declarative_base(cls=model_base.NeutronBaseV2) |
215 |
215 |
216 +if CONF.database.mysql_storage_engine == "NDBCLUSTER": |
216 +if CONF.database.mysql_storage_engine == "NDBCLUSTER": |
217 + db_string_length = 128 |
217 + db_string_length = 128 |
218 +else: |
218 +else: |
219 + db_string_length = 256 |
219 + db_string_length = 255 |
220 |
220 |
221 #neutron/db/models_v2.py |
221 #neutron/db/models_v2.py |
222 class HasTenant(object): |
222 class HasTenant(object): |
223 @@ -218,17 +225,30 @@ class Agent(BASEV2, HasId): |
223 @@ -218,17 +225,30 @@ class Agent(BASEV2, HasId): |
224 name='uniq_agents0agent_type0host'), |
224 name='uniq_agents0agent_type0host'), |
336 +CONF = config.neutron_config |
336 +CONF = config.neutron_config |
337 + |
337 + |
338 +if CONF.database.mysql_storage_engine == "NDBCLUSTER": |
338 +if CONF.database.mysql_storage_engine == "NDBCLUSTER": |
339 + db_string_length = 128 |
339 + db_string_length = 128 |
340 +else: |
340 +else: |
341 + db_string_length = 256 |
341 + db_string_length = 255 |
342 |
342 |
343 def upgrade(): |
343 def upgrade(): |
344 bind = op.get_bind() |
344 bind = op.get_bind() |
345 insp = sa.engine.reflection.Inspector.from_engine(bind) |
345 insp = sa.engine.reflection.Inspector.from_engine(bind) |
346 if 'agents' not in insp.get_table_names(): |
346 if 'agents' not in insp.get_table_names(): |