Add qos section to ovs agent config
[qos] section is introduced with qos driver for ovs agent. Similar manner should follow for all l2 agents using qos with different default drivers. Change-Id: I3c6a3711d3cd9924d55cf6d0ed84be18c993c275
This commit is contained in:
parent
24b26ad3aa
commit
a1c05891a5
|
@ -142,6 +142,10 @@
|
|||
# It should be false when you use nova security group.
|
||||
# enable_security_group = True
|
||||
|
||||
[qos]
|
||||
# QoS agent driver
|
||||
# agent_driver = ovs
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Sample Configurations.
|
||||
#-----------------------------------------------------------------------------
|
||||
|
|
|
@ -16,11 +16,12 @@
|
|||
import abc
|
||||
import collections
|
||||
|
||||
from oslo_utils import importutils
|
||||
from oslo_config import cfg
|
||||
import six
|
||||
|
||||
from neutron.agent.l2 import agent_extension
|
||||
from neutron.api.rpc.callbacks import resources
|
||||
from neutron import manager
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
|
@ -75,11 +76,9 @@ class QosAgentExtension(agent_extension.AgentCoreResourceExtension):
|
|||
resource by type and id
|
||||
"""
|
||||
super(QosAgentExtension, self).initialize(resource_rpc)
|
||||
#TODO(QoS) - Load it from Config
|
||||
qos_driver_cls = importutils.import_class(
|
||||
'neutron.plugins.ml2.drivers.openvswitch.agent.'
|
||||
'extension_drivers.qos_driver.QosOVSAgentDriver')
|
||||
self.qos_driver = qos_driver_cls()
|
||||
|
||||
self.qos_driver = manager.NeutronManager.load_class_for_provider(
|
||||
'neutron.qos.agent_drivers', cfg.CONF.qos.agent_driver)
|
||||
self.qos_driver.initialize()
|
||||
self.qos_policy_ports = collections.defaultdict(dict)
|
||||
self.known_ports = set()
|
||||
|
|
|
@ -100,7 +100,12 @@ agent_opts = [
|
|||
"timeout won't be changed"))
|
||||
]
|
||||
|
||||
qos_opts = [
|
||||
cfg.StrOpt('agent_driver', default='ovs', help=_('QoS agent driver.')),
|
||||
]
|
||||
|
||||
|
||||
cfg.CONF.register_opts(ovs_opts, "OVS")
|
||||
cfg.CONF.register_opts(agent_opts, "AGENT")
|
||||
cfg.CONF.register_opts(qos_opts, "qos")
|
||||
config.register_agent_state_opts_helper(cfg.CONF)
|
||||
|
|
|
@ -34,14 +34,10 @@ class QosAgentExtensionTestCase(base.BaseTestCase):
|
|||
self.qos_agent = qos_agent.QosAgentExtension()
|
||||
self.context = mock.Mock()
|
||||
|
||||
# Force our fake underlying QoS driver
|
||||
#TODO(QoS): change config value when we tie this to a configuration
|
||||
# entry.
|
||||
|
||||
self.import_patcher = mock.patch(
|
||||
'oslo_utils.importutils.import_class',
|
||||
return_value=mock.Mock())
|
||||
self.import_patcher.start()
|
||||
# Don't rely on used driver
|
||||
mock.patch(
|
||||
'neutron.manager.NeutronManager.load_class_for_provider',
|
||||
return_value=mock.Mock(spec=qos_agent.QosAgentDriver)).start()
|
||||
|
||||
self._create_fake_resource_rpc()
|
||||
self.qos_agent.initialize(self.resource_rpc_mock)
|
||||
|
|
|
@ -204,6 +204,8 @@ neutron.ipam_drivers =
|
|||
internal = neutron.ipam.drivers.neutrondb_ipam.driver:NeutronDbPool
|
||||
neutron.agent.l2.extensions =
|
||||
qos = neutron.agent.l2.extensions.qos_agent:QosAgentExtension
|
||||
neutron.qos.agent_drivers =
|
||||
ovs = neutron.plugins.ml2.drivers.openvswitch.agent.extension_drivers.qos_driver:QosOVSAgentDriver
|
||||
# These are for backwards compat with Icehouse notification_driver configuration values
|
||||
oslo.messaging.notify.drivers =
|
||||
neutron.openstack.common.notifier.log_notifier = oslo_messaging.notify._impl_log:LogDriver
|
||||
|
|
Loading…
Reference in New Issue