For PostgreSQL _list_availability_zones crashes if you're using
GROUP BY without object id. Use with_entities to use group_by
correctly.
Closes-bug: #1616793
Change-Id: Ibc09666bc5863a1980acd0a34d6545841a93a481
As there would be issue of circular imports while
implementation of Oslo-Versioned Objects for L3HArouter which has
db models definition and mixins in same file, this patch will
move L3HArouter models into a separate module.
Change-Id: I44e638fb4c19a2bdd513b67baeb7e6a2acc72d2f
Partial-Bug: #1597913
Change Idef2fe3e16b245da849e2d29c5578e5f5d081dc4 relocated the
RouterL3AgentBinding model, but the last rebase didn't change all the
references of this model - there was one left.
Change-Id: Id48d48413ecc2f55fc889b8d19a6760c16434d96
Partial-Bug: #1597913
Refactoring neutron ml2 drivers configuration options to be in
neutron/conf/plugins/ml2/drivers. This would allow centralization of
all configuration options and provides an easy way to import.
Change-Id: I825bfed769bff92de010733b16f4a4b5171a052c
Partial-Bug: #1563069
Refactoring l3 ha agent options to be in neutron/conf/agent/l3.
This would allow centralization of all configuration options and
provides an easy way to import.
Partial-Bug: #1563069
Change-Id: I2d6bd6beb0d1658baf88c49b954d2db3136e0c8d
As there would be issue of cyclic imports while the implementation
of Oslo-versioned Objects for Router Extra Attributes which has DB
models definition in same file, this patch will move Router Extra
Attributes model.
Change-Id: I8c90e35ef08ef74fb5309707673796e587a7289e
Partial-Bug: #1597913
Those are remnants from the oslo-incubator times. Also, oslo.messaging
deprecated [1] transport aliases since 5.2.0+ that is the minimal
version supported for stable/newton. The patch that bumped the minimal
version for Neutron landed 3 months+ ago, so we can proceed ripping
those aliases from the code base.
[1] I314cefa5fb1803fa7e21e3e34300e5ced31bba89
Change-Id: I9e66140ad0b10c50e216c78e4914c98313cada05
Closes-Bug: #1424728
As there would be issue of cyclic imports while implementation of
objects for router route which has db models definition and mixins
in same file, this patch will refactor router route models.
Change-Id: I6b71ab19cc7184ecbcde8808b95ef838379f0a39
Co-Authored-By: Victor Morales <victor.morales@intel.com>
The tests were creating tables in the memory but were not cleaning them
up, making them clash on attempt to create floatingips table.
Change-Id: If28ef4ce76cd36e7240d106b75e43d16f43e2c16
Closes-Bug: #1629347
This patch will relocate external network db models
and separate it from mixins for OVO implementation.
Change-Id: I83e2c7bbab3bd59cc9d2af71c66c0662c7724ecc
Partial-Bug: #1597913
Patch tests basic life-cycle of a trunk associated with a port. Test
creates a trunk with one subport - this tests interaction between
agent and ovsdb handler that calls via RPC to server.
Later a new subport is added which tests RPC interaction between
server and agent. Then deletes the first created subport. Finally trunk
is removed and checked that no patch ports remain on the integration
bridge.
Future work:
- Run this test with linuxbridge
- Test re-using port associated with trunk.
- Test re-using subports.
- Test with OVS firewall.
Partially-implements: blueprint vlan-aware-vms
Change-Id: Ie79a010e6751c1f1c2be5b1bf52511b9e100ad20
Those objects are intentionally not integrated into the database code so
far. This is to quicken access to their definitions to implement
push-notifications for networks.
Segments are part of the network object. Since we need to reduce the
number of SQL queries executed per resource, and we want to include
segmentation information for networks, Network model was extended with
segments relationship that makes the information available on every
network resource fetch from the database. This change required some
change in test_dhcp_agent_scheduler to expire a session used in the
tests to avoid obsolete segment state to be reused to validate
scheduling.
This implementation of the object is not complete for the job of
updating the resource in database. For example, tags are not yet exposed
on the object; also attributes like availability_zones, or external
network attributes, are not covered. Those attributes are hopefully
needed on server side only, so until we adopt the object for server
side, it should be ok to live without them.
Another database related thing still missing in this patch is lack of
RBAC support for the object. To complete this support,
a real get_bound_tenant_ids should be put onto the object, instead of
the current no-op stub.
This patch also includes some rearrangements that simplified the work.
Specifically, all network related objects are consolidated in the
neutron.objects.network module, instead of being scattered through the
code base. Also, some setup code from test_policy relevant to RBAC was
moved into the base test class so that it can be utilized by other RBAC
enabled objects, like network.
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Partially-Implements: blueprint push-notifications
Co-Authored-By: Victor Morales <victor.morales@intel.com>
Change-Id: I5160d0ab9e8042c356229420739db0ce42842368
In the l3_agent_scheduler.py file, some functions accept both the
'plugin' and 'context' argument. However, some functions expect
'context, plugin' (context first) and some functions expect
'plugin, context' (context last). I'm a real nit-picker and this
bothered me for a while, so here's a fix :)
Since the base scheduler class expects 'plugin, context', some functions
couldn't be changed to accept the other variation. Instead, context will
always be last. Also, modified unit tests to make sure they test.
This also fixes an odd-ordering in one of the dhcp scheduler's private
functions.
Change-Id: I825e108170a29d5ecaa0f0883bb0a171b5fdb895
This patch will separate ProviderResourceAssociation db models from
mixins for Oslo-Versioned Objects implementation work.
Change-Id: If650e0f6bdc41d175ba8be646cd043c875894ed7
Partial-Bug: #1597913
Those objects are intentionally not integrated into the database code so
far. This is to quicken access to their definitions to implement
push-notifications for security groups and ports.
The object embeds segmentation information in addition to what's
available through the model. Specifically, binding_levels field exposes
all ml2 binding levels, that from their side load corresponding network
segment object. The order for level objects in binding_levels list field
is guaranteed to be in the order of level. So the consumers can eg.
access the bottom binding info with:
port_obj.binding_levels[-1].segment
For PortBindingLevel object, we want to expose segmentation info. This
is achieved through a 'segment' ObjectField. The database model itself
contains segment_id too. There is no reason though to expose it for
Level object in two places (one as a model field, another one through
the ObjectField), so we avoid adding ID field. The base class that
handles loading for ObjectField based synthetic fields was assuming that
objects always have a field per model attribute, so it needed a slight
adjustment to support this case, where we extract foreign_keys
attributes from the model itself if the field is not present on the
object.
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Partially-Implements: blueprint push-notifications
Change-Id: I25de14e42e345d9235dbf4097c298ef5d606de51
Co-Authored-By: Martin Hickey <martin.hickey@ie.ibm.com>
Co-Authored-By: Rossella Sblendido <rsblendido@suse.com>
Co-Authored-By: Manjeet Singh Bhatia <manjeet.s.bhatia@intel.com>
Co-Authored-By: Brandon Logan <brandon.logan@rackspace.com>
Co-Authored-By: Victor Morales <victor.morales@intel.com>
This patch will relocate the VlanAllocation db model from
plugins/ml2/drivers to db/models and separate it from mixins for OVO
implementation.
Change-Id: Ib544b22c9e1acaf4025e8cdace694b2000a4da90
Partial-Bug: #1597913
This patch will separate metering db models from mixins
for OVO implementation work.
Change-Id: If1bdb64c36e1993d62269d390d3d18144b6c492d
Partial-Bug: #1597913