]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Handle qos_policy on network/port create/update
authorMike Kolesnik <mkolesni@redhat.com>
Wed, 15 Jul 2015 07:44:15 +0000 (10:44 +0300)
committerIhar Hrachyshka <ihrachys@redhat.com>
Sun, 19 Jul 2015 06:33:04 +0000 (08:33 +0200)
commit0395f142031bb200373b439c7798629eee1321eb
tree37ecaaa7457aaa0a999f054b59c85658ed4e3272
parentd8259702aa1e40adac784a41f4a648cce7b11ab9
Handle qos_policy on network/port create/update

Added handling for qos_policy_id field in the network and port
entities via ML2 extension driver.
The QoS profile will be associated to the network/port when requested as
part of the entity creation or update.

Allow ML2 extension manager to not register for any api extension
(new use case).

===

Extend the resources using the QoS extension class

Since the QoS extension for plugins is handles by this class, it makes
sense for it to handle also property extension of resources.

For ML2 this means that that extend_{network,port}_dict functions will
handle the extension of resources by calling QosExtensionHandler.
This logic can easily be reused by other plugins.

Note: we should make sure that resource extension does not require db
access, otherwise we see DBDeadLock errors and random tempest failures.
To achieve this, we define a new SQLAlchemy joined relationship on
policy bindings to make networks and ports receive those bindings on
their fetch from database. After that, the only work to do left for
resource extension handler is to copy the fetched policy into resource
dictionary.

===

Also enable new qos ml2 extension until we configure it in gate via
project-config and devstack-gate to make sure it's enabled and tested.

Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Partially-implements: blueprint quantum-qos-api
Change-Id: I1b7d4611215a471d5c24eb3d7208dcddb7e015f4
neutron/db/qos/models.py
neutron/plugins/ml2/driver_api.py
neutron/plugins/ml2/extensions/qos.py [new file with mode: 0644]
neutron/plugins/ml2/managers.py
neutron/plugins/ml2/plugin.py
neutron/services/qos/qos_extension.py [new file with mode: 0644]
neutron/services/qos/qos_plugin.py
neutron/tests/unit/services/qos/__init__.py [new file with mode: 0644]
neutron/tests/unit/services/qos/test_qos_extension.py [new file with mode: 0644]
setup.cfg