Running with a stricter .pylintrc generates a lot of
C0330 warnings (hanging/continued indentation). Fix
the ones in neutron/db.
Trivialfix
Change-Id: I9311cfe5efc51552008072d84aa238e5d0c9de60
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>
Those were moved under neutron.db.models start of Ocata. We should be
able to clean them up now.
NeutronLibImpact
Change-Id: Iadbf44d52ee8e30712807384152a29ce1a8b8f72
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
This patch creates and integrates ProviderResourceAssociation model
class to Oslo Versioned Object.
Change-Id: I13703f867c93d3fa6477771e43121b3818b8ebf9
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Use reader and writer for db operations with servicetype.
Partially-Implements blueprint: enginefacade-switch
Change-Id: I7cf29890d4d498c241a7c6e99edfbfc258b8cb60
This patch will separate ProviderResourceAssociation db models from
mixins for Oslo-Versioned Objects implementation work.
Change-Id: If650e0f6bdc41d175ba8be646cd043c875894ed7
Partial-Bug: #1597913
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
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
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
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
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
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
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>
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
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
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
This change renames everything to Neutron while providing backwards
compatible adjustments for Grizzly configuration files.
implements blueprint: remove-use-of-quantum
Change-Id: Ie7d07ba7c89857e13d4ddc8f0e9b68de020a3d19