# License for the specific language governing permissions and limitations
# under the License.
+from oslo.config import cfg
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.orm import exc
LOG = logging.getLogger(__name__)
+AGENTS_SCHEDULER_OPTS = [
+ cfg.StrOpt('network_scheduler_driver',
+ default='neutron.scheduler.'
+ 'dhcp_agent_scheduler.ChanceScheduler',
+ help=_('Driver to use for scheduling network to DHCP agent')),
+ cfg.StrOpt('router_scheduler_driver',
+ default='neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
+ help=_('Driver to use for scheduling '
+ 'router to a default L3 agent')),
+ cfg.BoolOpt('network_auto_schedule', default=True,
+ help=_('Allow auto scheduling networks to DHCP agent.')),
+ cfg.BoolOpt('router_auto_schedule', default=True,
+ help=_('Allow auto scheduling routers to L3 agent.')),
+ cfg.IntOpt('dhcp_agents_per_network', default=1,
+ help=_('Number of DHCP agents scheduled to host a network.')),
+]
+
+cfg.CONF.register_opts(AGENTS_SCHEDULER_OPTS)
+
class NetworkDhcpAgentBinding(model_base.BASEV2):
"""Represents binding between neutron networks and DHCP agents."""
from neutron.openstack.common.rpc import proxy
from neutron.plugins.brocade.db import models as brocade_db
from neutron.plugins.brocade import vlanbm as vbm
-from neutron import scheduler
LOG = logging.getLogger(__name__)
cfg.CONF.register_opts(SWITCH_OPTS, "SWITCH")
cfg.CONF.register_opts(PHYSICAL_INTERFACE_OPTS, "PHYSICAL_INTERFACE")
-cfg.CONF.register_opts(scheduler.AGENTS_SCHEDULER_OPTS)
class BridgeRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin,
from oslo.config import cfg
from neutron.agent.common import config
-from neutron import scheduler
DEFAULT_VLAN_RANGES = []
DEFAULT_INTERFACE_MAPPINGS = []
cfg.CONF.register_opts(vlan_opts, "VLANS")
cfg.CONF.register_opts(bridge_opts, "LINUX_BRIDGE")
cfg.CONF.register_opts(agent_opts, "AGENT")
-cfg.CONF.register_opts(scheduler.AGENTS_SCHEDULER_OPTS)
config.register_agent_state_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
from oslo.config import cfg
-from neutron import scheduler
-
ml2_opts = [
cfg.ListOpt('type_drivers',
cfg.CONF.register_opts(ml2_opts, "ml2")
-cfg.CONF.register_opts(scheduler.AGENTS_SCHEDULER_OPTS)
from neutron.agent.common import config
from neutron.openstack.common import rpc # noqa
-from neutron import scheduler
ovs_opts = [
cfg.CONF.register_opts(ofc_opts, "OFC")
config.register_agent_state_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
-cfg.CONF.register_opts(scheduler.AGENTS_SCHEDULER_OPTS)
# shortcuts
CONF = cfg.CONF
from oslo.config import cfg
-from neutron import scheduler
-
nvp_opts = [
cfg.IntOpt('max_lp_per_bridged_ls', default=64,
help=_("Maximum number of ports of a logical switch on a "
cfg.CONF.register_opts(connection_opts)
cfg.CONF.register_opts(cluster_opts)
cfg.CONF.register_opts(nvp_opts, "NVP")
-cfg.CONF.register_opts(scheduler.AGENTS_SCHEDULER_OPTS)
# NOTE(armando-migliaccio): keep the following code until we support
# NVP configuration files in older format (Grizzly or older).
# ### BEGIN
from neutron.agent.common import config
from neutron.plugins.openvswitch.common import constants
-from neutron import scheduler
DEFAULT_BRIDGE_MAPPINGS = []
cfg.CONF.register_opts(agent_opts, "AGENT")
config.register_agent_state_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF)
-cfg.CONF.register_opts(scheduler.AGENTS_SCHEDULER_OPTS)
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-
-from oslo.config import cfg
-
-
-AGENTS_SCHEDULER_OPTS = [
- cfg.StrOpt('network_scheduler_driver',
- default='neutron.scheduler.'
- 'dhcp_agent_scheduler.ChanceScheduler',
- help=_('Driver to use for scheduling network to DHCP agent')),
- cfg.StrOpt('router_scheduler_driver',
- default='neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
- help=_('Driver to use for scheduling '
- 'router to a default L3 agent')),
- cfg.BoolOpt('network_auto_schedule', default=True,
- help=_('Allow auto scheduling networks to DHCP agent.')),
- cfg.BoolOpt('router_auto_schedule', default=True,
- help=_('Allow auto scheduling routers to L3 agent.')),
- cfg.IntOpt('dhcp_agents_per_network', default=1,
- help=_('Number of DHCP agents scheduled to host a network.')),
-]
self.assertIn(constants.DUMMY, svc_plugins.keys())
def test_post_plugin_validation(self):
+ cfg.CONF.import_opt('dhcp_agents_per_network',
+ 'neutron.db.agentschedulers_db')
+
self.assertIsNone(validate_post_plugin_load())
cfg.CONF.set_override('dhcp_agents_per_network', 2)
self.assertIsNone(validate_post_plugin_load())