Commit Graph

112 Commits

Author SHA1 Message Date
Jenkins 890f5ed0fd Merge "Relocate Agent DB model" 2016-10-10 16:33:55 +00:00
Jenkins 838f331bd3 Merge "Relocate DNS db models" 2016-10-08 14:13:55 +00:00
Manjeet Singh Bhatia ead39faa37 Relocate DNS db models
This patch relocate db models for dns.

Partial-Bug: #1597913

Change-Id: I6d1b43d8c5c8d6f8b80730a16eedac5e59cbed44
2016-10-07 21:35:35 +00:00
tonytan4ever e669e7b96b Relocate Agent DB model
This patch set is for breaking the circular dependency between
Agent/AgentVersionedObject.
See:https://review.openstack.org/#/c/297887/ for details.

Change-Id: I7be4ce2513e49e6da46a7bdffb8538613f0be7c7
Partial-Bug: #1597913
Co-Authored-By: Victor Morales <victor.morales@intel.com>
Co-Authored-By: Sindhu Devale <sindhu.devale@intel.com>
2016-10-07 14:18:19 -04:00
sindhu devale 72ddd2338b Relocate Segment DB Models
As there would be issue of cyclic imports while implementation of
objects for segments which has db models definition and mixins in same
file, this patch will relocate segment models.

Change-Id: I6f5aea69a0f7f1647bb06c86f1fac9367717033c
Partial-Bug: #1597913
Co-Authored-By: Victor Morales <victor.morales@intel.com>
2016-10-05 13:06:39 -05:00
Victor Morales fc93f7fcdb Relocate Flavor and ServiceProfile DB models
This patch will separate flavor and service profile db models from
mixins for Oslo-Versioned Objects implementation work.

Change-Id: Ia35d24c075dc716e44fbf8a9b6a2ebb0297e7aa9
Partial-Bug: #1597913
2016-10-05 08:15:20 -05:00
Jenkins 12b2de7bae Merge "Relocate dvr model" 2016-10-05 04:33:11 +00:00
Jenkins 6729311d6e Merge "Relocate Tag DB model" 2016-10-05 04:32:55 +00:00
Jenkins 4e33f2516e Merge "Relocate SegmentHostMapping DB model" 2016-10-04 15:26:51 +00:00
tonytan4ever 509bc4c2ab Relocate dvr model
As there would be issue of cyclic imports while implementation of
Oslo-Versioned Objects for DVR which has db models definition and
mixins in same file, this patch will relocate DVR models.

Change-Id: I4005570c7507ae9c28fd2910b368e4fdf5e603b0
Co-Authored-By: Victor Morales <victor.morales@intel.com>
Partial-Bug: #1597913
2016-10-04 08:41:33 +00:00
sindhudevale f9b1f0906c Relocate L3HARouter DB model
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
2016-10-03 11:48:17 -05:00
Jenkins b516691490 Merge "Relocate Router Extra Attributes DB Model" 2016-10-03 15:37:31 +00:00
Aradhana Singh b6a296edf6 Relocate Tag DB model
This patch relocates Tag db model from neutron/db to neutron/db/models

Change-Id: Ibb9325f30af85300afe62bb5415388271cf13833
Partial-Bug: #1597913
2016-10-03 10:20:05 -05:00
Aradhana Singh cf6d700390 Relocate SegmentHostMapping DB model
This patch relocates SegmentHostMapping db model to neutron/db/models.

Partial-Bug: #1597913

Change-Id: I630e5c42f9ab781ba6565cdf0f780bf78c2b5dc7
2016-09-30 12:59:29 -05:00
Shashank Kumar Shankar 22b4f037dd Relocate Router Extra Attributes DB Model
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
2016-09-30 15:59:38 +00:00
sindhudevale a53a4d9464 Relocate router route DB model
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>
2016-09-30 09:58:02 -04:00
Jenkins ecd43d2e38 Merge "Relocate external network db models" 2016-09-30 13:38:44 +00:00
Jenkins c7610950f7 Merge "Relocate ProviderResourceAssociation DB models" 2016-09-30 13:38:17 +00:00
Jenkins fa72a58a72 Merge "Relocate Geneve DB models" 2016-09-30 13:24:56 +00:00
Jenkins 9d9d592d72 Merge "Relocate Provisioning Block DB Model" 2016-09-30 09:05:10 +00:00
Jenkins ea7abe7bdb Merge "Relocate RouterL3AgentBinding DB model" 2016-09-29 23:43:30 +00:00
sindhudevale e1a832dad8 Relocate Geneve DB models
To avoid cyclic imports for OVO work.

Change-Id: Iebd5a44d2195276e92111cb8964b90fc2955e2de
Partial-Bug: #1597913
2016-09-29 15:48:31 -05:00
Jenkins ec158688f4 Merge "Relocate VlanAllocation DB model" 2016-09-29 19:16:56 +00:00
Manjeet Singh Bhatia 276015788a Relocate external network db models
This patch will relocate external network db models
and separate it from mixins for OVO implementation.

Change-Id: I83e2c7bbab3bd59cc9d2af71c66c0662c7724ecc
Partial-Bug: #1597913
2016-09-29 17:51:39 +00:00
Victor Morales 286af7c3f0 Relocate ProviderResourceAssociation DB models
This patch will separate ProviderResourceAssociation db models from
mixins for Oslo-Versioned Objects implementation work.

Change-Id: If650e0f6bdc41d175ba8be646cd043c875894ed7
Partial-Bug: #1597913
2016-09-29 08:33:56 -05:00
Anindita Das 558c0519e1 Relocate VlanAllocation DB model
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
2016-09-28 18:12:21 +00:00
Manjeet Singh Bhatia 820270fcac Relocate Metering DB models
This patch will separate metering db models from mixins
for OVO implementation work.

Change-Id: If1bdb64c36e1993d62269d390d3d18144b6c492d
Partial-Bug: #1597913
2016-09-28 17:30:39 +00:00
sindhudevale 930655cf57 Relocate RouterL3AgentBinding DB model
As there would be issue of cyclic imports while
implementation of objects for l3agentbinding which has
db models definition and mixins in same file, this patch will
relocate l3agentbinding models.

Change-Id: Idef2fe3e16b245da849e2d29c5578e5f5d081dc4
Partial-Bug: #1597913
2016-09-28 09:20:27 -05:00
Jenkins b3852bd063 Merge "Relocate VxlanAllocation/VxlanEndpoints DB model" 2016-09-28 02:00:33 +00:00
Jenkins f4ba9ea8ac Merge "Relocate L3 DB Models" 2016-09-28 01:46:47 +00:00
Manjeet Singh Bhatia 2b66c6a2ed Relocate L3 DB Models
As we have started oslo versioned objects implementations. There
would be issue of cyclic import while implementation for objects
which have db models definitions and mixins in same file. This patch
will move routers models as discussed in [1].

For example DNS models and some queries are in same file [2]. for object
implementation I have separate models definitions and mixins where
queries were being done [3].

[1]. https://www.mail-archive.com/openstack-dev@lists.openstack.org/msg88910.html
[2]. https://review.openstack.org/#/c/334695/15/neutron/db/dns_db.py
[3]. https://review.openstack.org/#/c/334695/15/neutron/db/models/dns_models.py

Change-Id: I9b9a44da5d28252be58cea1a920a64e18d8bbf32
Partial-Bug: #1597913
2016-09-27 16:58:55 +00:00
Shashank Kumar Shankar 0d81441af5 Relocate Provisioning Block DB Model
As there would be issue of cyclic imports while implementation of
objects for Provisioning Block which has db models definition in same
file, this patch will move Provisioning Block model.

Change-Id: I74402153267cac79a530c4f4f5bb7fd7df247e78
Partial-Bug: #1597913
2016-09-27 04:30:03 +00:00
Nakul Dahiwade 74229030b8 Relocate PortBindingPort DB Model
This patch moves PortBindingPort model under neutron/db/models for
consistency.There are no plans to implement an OVO object for the model
at this point in time. Actually, the model should probably eventually
go away from Neutron tree since it's not used by reference plugin,
and is just a remnant from the times when the neutron tree contained
lots of plugins, some of which were using the model.

Change-Id: I5728fea38816b7e500eaa836d5c5dadef51457f7
Partial-Bug: #1597913
2016-09-22 19:35:03 +00:00
Anindita Das b078060189 Relocate VxlanAllocation/VxlanEndpoints DB model
This patch will relocate the VxlanAllocation and VxlanEndpoints db
model from plugins/ml2/drivers to db/models/plugins/ml2 and separate
it from mixins for OVO implementation.

Change-Id: I14702ddcc5c32ba34b5f905a15cd816a69ef2b49
Partial-Bug: #1597913
2016-09-22 16:28:52 +00:00
Henry Gessau 61cc14fd67 Switch to neutron-lib for model_base
Change-Id: If5b2b4cc0346515ddef3da1255ab49327c8e5732
2016-08-31 11:12:18 -04:00
Jenkins bf569b1360 Merge "Relocate Flat Allocation DB model" 2016-08-29 12:34:48 +00:00
sindhudevale a2e915977a Relocate Flat Allocation DB model
Since there would be a circular import issue once we try to
implement an object relying on the model, and adopt it in tree
for database accessing code, this patch prepares the ground for
this work by moving the model out of database accessing
modules into neutron/db/models.

Change-Id: I7876d28d35c5c4b9167520733e1a1b08dabc6951
Partial-Bug: #1597913
2016-08-29 10:01:16 +00:00
Mohit Malik d7e6ce8a6e Relocate GRE Db models
Change-Id: I00afedc08c9ed7ab03ead9ef4bee94a80f50bb75
Partial-Bug: #1597913
2016-08-19 11:52:57 -07:00
Mohit Malik 72a722e69d Relocate AddressScope DB model
Required to resolve cyclic import issue when integrating with Oslo
Versioned Object for AddressScope

Change-Id: If57e472c5827033f09a59d1f8d9359a3f241c17c
Partial-Bug: #1597913
2016-08-17 14:43:44 -07:00
Ihar Hrachyshka 5925364c9a Fixed neutron-db-manage without neutron/tests installed
With 7c0f189309 in tree, we made
neutron-db-manage require neutron/tests/tools.py installed. Some
distributions, like RDO, may split the python package into core package
and the one that contains python code needed for testing only (anything
under neutron/tests/), and hence don't guarantee that all setups have
neutron.tests package available.

This fix moves the import_module_recursively function from
neutron.tests.tools into neutron.common.utils because it has non-testing
use cases. All existing cases where we use the function switched to the
new location. The old symbol still works, though triggers a deprecation
warning, and will be removed in the next cycle.

Change-Id: Ia8d91a1704c894bc1f6cf14e6cdd971fab255b62
Closes-Bug: #1612959
2016-08-15 06:31:13 +00:00
Ihar Hrachyshka 7c0f189309 models: move AllowedAddressPair model under neutron/db/models
This patch moves the module into the canonical place. It does it in
backwards compatible way, by leaving the model available under the old
location, only emitting a deprecation warning on access from there. In
the future, the old module will be completely cleaned up.

This patch also makes head.py file that is used to import and register
all models in the tree to import everything from under neutron.db.models
without explicitly naming each module. In that way, we can avoid the
need to import each new module with models as long as it's located in
the designated place. The file is a well known abuser in terms of git
conflicts, and it's better to avoid manual work.

Change-Id: I084031e6b3c8d9113cc6ee6e3967f0e1edaee0b5
Partial-Bug: #1597913
2016-08-12 12:27:06 +00:00
Victor Morales a92647300d Relocate Security Group DB models
This patch will separate security group db models from mixins for OVO
implementation work.

Change-Id: Ie38d3cc2efa5f580261f207748affb5840ba23c9
Partial-Bug: #1597913
2016-08-11 13:49:53 +02:00
Ihar Hrachyshka 9fcc8c52c9 objects: introduce NetworkPortSecurity object
Since there are two models for binding, and it's easier if they behave
identically from objects POV, renamed port_id field in PortSecurity into
id, and kept the same fields in NetworkPortSecurity.

Switched db code to using those objects. Some refactoring took place to
reduce code duplication.

Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Change-Id: Ic104f113c4aa3f0c1448f83fe5128feed7b4444b
2016-06-27 18:35:47 +02:00
Jakub Libosvar 766abb752a Make pep8 job great again
There is a bug in pep8, when 'select' used, it omits all default checks
and runs only those specified by 'select'.  We got hit by this issue
since I2d26534230ffe5d01aa0aab6ec902f81cfba774d was merged which lead to
almost no static checks in pep8 job.

Also note that off_by_default decorator has no effect for now because
factory in hacking is triggered after ignored checks are collected.
There will be a follow-up patch for that in order to make pep8 doing
its job quickly.

[1] https://github.com/PyCQA/pycodestyle/issues/390

Related-Bug: 1594756
Change-Id: I8e27f40908e1bb4307cc7c893169a9d99f3433c4
2016-06-21 16:23:51 +00:00
Hong Hui Xiao 16aa695880 Use callback to update SegmentHostMapping
agents_db is implicitly imported by neutron.db.models_v2.

This refactor delete the the import of neutron.services.segments.db,
which could avoid potential circle import.

Change-Id: I880bb07f407e2d95037b078c6fa91bccf537b99d
Partially-Implements: blueprint routed-networks
2016-06-08 02:46:31 +00:00
Jenkins 32316ba162 Merge "Integrate the port allowed address pairs VersionedObject in Neutron" 2016-05-24 13:02:31 +00:00
Martin Hickey 8ecb28dd09 Integrate the port allowed address pairs VersionedObject in Neutron
This patch is dependent on commit I8d03528f8f45f5f50fa467b39245a513a37c5d89.
It integrates the VersionedObject with the existing code.

Integration revealed that using IPAddress is not correct for allowed
address pairs, because the address can also represent a subnet.

Another issue revealed by the integration is that we must retain the
original string format passed by users through API for MAC addresses.

Neither we can use IPNetworkField from oslo.versionedobjects for
ip_address field because it will then always append prefix length to
base network address, even if prefix length is maximum for the type of
IP network (meaning, the address actually represents a single host),
which is contradictory to how API currently behaves (returning mask-less
addresses for /32 - for ipv4 - and /128 - for ipv6 - prefix lengths).

To solve those issues, 'authentic' flavors for netaddr.EUI and
netaddr.IPNetwork types are introduced. Those 'authentic' flavors
attempt to retain the original string representation, as passed by the
caller.

Since base IPNetworkField recreates network object on coerce(), and
hence looses information about the original string representation, we
introduce our custom flavor of the field type that reuses the network
object passed by the caller.

The change for the type of ip_address field triggers hash change.
Anyway, we are safe to change it without considering backwards
compatibility, because the object is not used anywhere yet.

Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Change-Id: I3c937267ce789ed510373616713b3fa9517c18ac
Partial-Bug: #1541928
2016-05-20 15:18:22 +02:00
Kevin Benton b672c26cb4 Add provisioning blocks to status ACTIVE transition
Sometimes an object requires multiple disjoint actors to complete
a set of tasks before the status of the object should be transitioned
to ACTIVE. The main example of this is when a port is being created.
The L2 agent has to do its business to wire up the VIF, but at the same
time the DHCP agent has to setup the DHCP reservation. This led to
Nova booting the VM when the L2 agent was done even though the DHCP
agent may have been nowhere near ready.

This patch introduces a provisioning blocks mechansim that allows the
entities to be tracked that need to be involved to make a transition
to ACTIVE happen. See the devref in the dependent patch for a high-level
view of how this works.

The ML2 code is updated to use this new mechanism to prevent updating
the port status to ACTIVE without both the DHCP agent and L2 agent
reporting that the port is ready.

The DHCP RPC API required a version bump to allow the port ready
notification.

This also adds a devref doc for the provisioning_blocks
module with a high-level overview of how it works in addition
to a detailed description of how it is used specifically with
ML2, the L2 agents, and the DHCP agents.

Closes-Bug: #1453350
Change-Id: Id85ff6de1a14a550ab50baf4f79d3130af3680c8
2016-05-11 11:03:09 -07:00
Jenkins fe702f8f2a Merge "Remove BGP code from neutron" 2016-04-27 16:20:41 +00:00
Armando Migliaccio e8d3626d1c Remove BGP code from neutron
Once the spinout is undergoing we should perform the eviction.

Partially-implements: blueprint bgp-spinout

Depends-on: I8be510153edbc496575cde34943ca4c56645e0fb
Change-Id: I20b6ddd37d10eae70e8294d578e53137c0f866fe
2016-04-25 21:54:06 -07:00