Commit Graph

22 Commits

Author SHA1 Message Date
Brian Haley 55b16d7b7c Fix some pylint indentation warnings
Running with a stricter .pylintrc generates a lot of
C0330 warnings (hanging/continued indentation). Fix
the ones in neutron/db.

Trivialfix

Change-Id: I9311cfe5efc51552008072d84aa238e5d0c9de60
2022-11-03 19:50:54 -04:00
Rodolfo Alonso Hernandez d279ec1180 Switch to new engine facade for ExtraRoute_dbonly_mixin
Partially-Implements blueprint: enginefacade-switch

Change-Id: I355c39bde8d2d16baddf08af61b780b71981abab
2019-06-28 10:30:56 +00:00
Brian Haley eaf990b2bc Fix pep8 E128 warnings in non-test code
Reduces E128 warnings by ~260 to just ~900,
no way we're getting rid of all of them at once (or ever).
Files under neutron/tests still have a ton of E128 warnings.

Change-Id: I9137150ccf129bf443e33428267cd4bc9c323b54
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
2019-03-12 21:22:33 +00:00
Ihar Hrachyshka 88e99f6f28 Clean up deprecated sqla model import paths
Those were moved under neutron.db.models start of Ocata. We should be
able to clean them up now.

NeutronLibImpact

Change-Id: Iadbf44d52ee8e30712807384152a29ce1a8b8f72
2017-02-25 03:42:34 +00:00
Ihar Hrachyshka 0ec47f9eb4 objects: add delete_objects public method
Sometimes we don't need to construct objects before deleting them, and
it's a waste to do so. It may also be easier to use a single
delete_objects call instead of a loop with get_objects and delete.

This patch introduces a method that will delete all matching resources
without constructing full blown versioned objects.

before:

    for obj in cls.get_objects(...):
        obj.delete()

after:

    cls.delete_objects(...)

delete_objects also returns the number of entries deleted from DB.

The default non-db implementation relies on get_objects and delete
methods, meaning it still constructs objects.

Co-Authored-By: Artur Korzeniewski <artur.korzeniewski@intel.com>
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Change-Id: I94a79d244b80421f77b714c94248d8ec55c95946
2016-12-13 17:35:47 +00:00
Victor Morales c932b69356 ProviderResourceAssociation to OVO
This patch creates and integrates ProviderResourceAssociation model
class to Oslo Versioned Object.

Change-Id: I13703f867c93d3fa6477771e43121b3818b8ebf9
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
2016-11-18 13:09:29 -06:00
Ann Kamyshnikova 9cb31b1e25 Use new enginefacade for servicetype_db
Use reader and writer for db operations with servicetype.

Partially-Implements blueprint: enginefacade-switch

Change-Id: I7cf29890d4d498c241a7c6e99edfbfc258b8cb60
2016-11-14 12:34: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
Henry Gessau 61cc14fd67 Switch to neutron-lib for model_base
Change-Id: If5b2b4cc0346515ddef3da1255ab49327c8e5732
2016-08-31 11:12:18 -04:00
Kevin Benton 9a177e1fa0 Add method to get service provider names by resources
This adds a method to the service type framework to retrieve
the names of the resource providers associated with a list
of resource IDs. This will be used by the L3 flavor framework
to lookup all of the associated drivers for a list of routers.

Partially-Implements: bp/multi-l3-backends
Change-Id: I4f0d7df493c5a5a7b00dc6f43d3827536a474a40
2016-05-12 07:40:45 -07:00
Brandon Logan f218929bc5 Force service provider relationships to load
A race condition was exposed in the LBaaS V2 db layer that was caused by a
hack to get around this issue.  The real issue is that since the
ProviderResourceAssociation is inserted independently, any models that were
created before this insert will not have their relationship with the
ProviderResourceAssocation loaded.  Using the session.expire_all method will
force the session to retrieve all new data and load this relationship for any
resource that uses this relationship.

Change-Id: I940b541f4ef9c489126cd2d215b1d857f0624de0
Closes-Bug: #1504465
2015-12-10 01:26:51 -06:00
Manjeet Singh Bhatia ae40bf1fd9 Reuse constants defined in attributes
This change reuses constants defined in attributes module in db
modules.

Change-Id: Idbb5f21a485a41a814b6b8c5744348d25443239e
2015-12-04 05:14:55 +00:00
armando-migliaccio 9022fb1ae8 Remove implicit registration of *-aas service providers
Implicit registration can be dropped when explicit registration
for load balancer and vpn is implemented. Firewall does not
use service providers and the ServiceTypeManager, so the
precautionary step can be dropped altogether.

Support for configuring providers via the service_providers section
in neutron.conf, is no longer available, hence clear the stale
entry points.

DocImpact

Closes-bug: #1473110

Change-Id: I5e1d254b9a3a24121d9e9d3cb82f877d44079296
2015-09-02 16:13:59 +00:00
armando-migliaccio 61121c5f2a Decentralize the managemement of service providers
After the service split, some of the configuration, parsing and
validation was kept in the neutron core; ultimately this needs to
get closer to the services where it belongs.

This patch starts from ProviderConfiguration and ServiceTypeManager
classes, and aims at removing the hard-coded elements, like the list
of known advanced services, so that in the long run we can make
Neutron easier to plug with external services.

Partial-bug: #1473110

Depends-on: I44edcceba37ac58efcc0a53c9d1f835d9530344a
Depends-on: I8924234aadf786801ffc100d7daa27acc145a195
Change-Id: Ia4cad678e6c722ca05821dbdbf05d61523246a86
2015-09-01 03:27:13 +00:00
Ihar Hrachyshka 22328baf1f Migrate to oslo.log
It's mostly a matter of changing imports to a new location.

Non-obvious changes needed:
* pass overwrite= argument to oslo_context since oslo.log reads context
  from its thread local store and not local.store from incubator
* don't store context at local.store now that there is no code that
  would consume it
* LOG.deprecated() -> versionutils.report_deprecated_feature()
* dropped LOG.audit check from hacking rule since now the method does
  not exist
* WritableLogger is now located in oslo_log.loggers

Dropped log module from the tree. Also dropped local module that is now
of no use (and obsolete, as per oslo team).

Added versionutils back to openstack-common.conf since now we use the
module directly from neutron code and not just as a dependency of some
other oslo-incubator module.

Note: tempest tests are expected to be broken now, so instead of fixing
all the oslo.log related issues for the subtree in this patch, I only
added TODOs with directions for later fix.

Closes-Bug: #1425013
Change-Id: I310e059a815377579de6bb2aa204de168e72571e
2015-03-12 11:22:56 +01:00
Gary Kotton 7edf58495e Remove @author(s) from copyright statements
We have git to track authorship, so let's not pad source files
with it as well.

A hacking check has been added for this. The value is N322.

Change-Id: Iab0b64d417e0bb41a6b455e2ac377deee64ec3ee
2014-09-15 21:40:09 +09:00
Salvatore Orlando 9bf0e66544 Remove auto-generation of db schema from models at startup
This patch removes the Neutron capability of creating database tables
from sqlalchemy models for all those model classes for which
a table is not found in the database schema.
Migrations should be the official and only solution for creating and
managing the Neutron db schema.
This patch also adapts unit tests in order to ensure test schemas
are still correctly created.

DocImpact
Update deployment documentation accordingly.

Closes-Bug: #1207402

Change-Id: Ie4ee5507888ecad5f6dc32ce7a029c43014687a2
Co-Authored-By: Henry Gessau <gessau@cisco.com>
2014-08-15 17:21:17 -04:00
sanuptpm 598accd415 Fix spelling mistakes
Change-Id: Idedb39b43bc71db0a7e331cc23535d162177c8b5
2014-08-01 16:10:23 +00:00
Mohammad Banikazemi 5a701d730a Removing vim header lines
Simply removes the vim header line and the empty line
following it (when present) for files in the api, db, and
extenssions base directories. In one single _init_ file in
this patchset, all comment lines are removed.

Change-Id: I81b7168dc2ad74b8c30a87e50a531e157851499e
Partial-Bug: 1229324
2014-04-01 10:38:31 -04:00
Eugene Nikanorov 88dd89b2ff LBaaS integration with service type framework
The patch makes the following changes:

* adds new attribute of the pool: provider, which is provider name
as it is written in configuration
* adds support for multiple plugin drivers for loadbalancer
* cleans up healthmonitor-related plugin driver API
Drivers should work with healthmonitor associations only
* adds ability to update provider attribute for the pool used
to reassociate pools with new providers in case their providers
were removed from configuration

implements blueprint lbaas-integration-with-service-types

DocImpact

Change-Id: I4295c9bcceb38e60f813d5596af48bd8194c1c9b
2013-09-03 23:05:33 +04:00
Eugene Nikanorov 1b36e20771 Service Type Framework refactoring
implements blueprint service-type-framework-cleanup

* Defines logic and API for ServiceProvider - read-only entity
that admins provide in configuration and which is stored in memory
* ServiceType entity which maps to ServiceOfferings in new terms
is removed for now.
* Routed service insertion fixed to not to refer to service providers.
* In case configuration changes and some service providers are removed
then the resources must be cleanup in a special way (undeploy logical
resources). This is a matter of future work
* Add migration.

Change-Id: I400ad8f544ec8bdc7d2efb597c995f284ff05829
2013-07-25 21:47:30 +04:00
Mark McClain ee3fe4e836 Rename Quantum to Neutron
This change renames everything to Neutron while providing backwards
compatible adjustments for Grizzly configuration files.

implements blueprint: remove-use-of-quantum

Change-Id: Ie7d07ba7c89857e13d4ddc8f0e9b68de020a3d19
2013-07-06 15:02:43 -04:00