예제 #1
0
 def test_override_config_list_value(self):
     self.cfg(args=['--thelist=quantum,neutron,quantum.Quantum'])
     legacy.override_config(self.cfg, ['thelist'])
     self.assertEqual(
         self.cfg.thelist,
         ['neutron', 'neutron', 'neutron.Neutron']
     )
예제 #2
0
파일: quota.py 프로젝트: cnesa/neutron
                      'minus for unlimited')),
    cfg.IntOpt('quota_subnet',
               default=10,
               help=_('Number of subnets allowed per tenant, '
                      'minus for unlimited')),
    cfg.IntOpt('quota_port',
               default=50,
               help=_('Number of ports allowed per tenant, minus for '
                      'unlimited')),
    cfg.StrOpt('quota_driver',
               default='neutron.db.quota_db.DbQuotaDriver',
               help=_('Default driver to use for quota checks')),
]
# Register the configuration options
cfg.CONF.register_opts(quota_opts, 'QUOTAS')
legacy.override_config(cfg.CONF, [('QUOTAS', 'quota_driver')])


class ConfDriver(object):
    """Configuration driver.

    Driver to perform necessary checks to enforce quotas and obtain
    quota information. The default driver utilizes the default values
    in neutron.conf.
    """

    def _get_quotas(self, context, resources, keys):
        """Get quotas.

        A helper method which retrieves the quotas for the specific
        resources identified by keys, and which apply to the current
예제 #3
0
파일: plugin.py 프로젝트: SylvainA/neutron
from neutron.plugins.common import constants
from neutron.services.loadbalancer import agent_scheduler

LOG = logging.getLogger(__name__)

DEFAULT_DRIVER = ("neutron.services.loadbalancer.drivers.haproxy"
                  ".plugin_driver.HaproxyOnHostPluginDriver")

lbaas_plugin_opts = [
    cfg.StrOpt('driver_fqn',
               default=DEFAULT_DRIVER,
               help=_('LBaaS driver Fully Qualified Name'))
]

cfg.CONF.register_opts(lbaas_plugin_opts, "LBAAS")
legacy.override_config(cfg.CONF, [('LBAAS', 'driver_fqn')])


class LoadBalancerPlugin(loadbalancer_db.LoadBalancerPluginDb,
                         agent_scheduler.LbaasAgentSchedulerDbMixin):

    """Implementation of the Neutron Loadbalancer Service Plugin.

    This class manages the workflow of LBaaS request/response.
    Most DB related works are implemented in class
    loadbalancer_db.LoadBalancerPluginDb.
    """
    supported_extension_aliases = ["lbaas", "lbaas_agent_scheduler"]

    # lbaas agent notifiers to handle agent update operations;
    # can be updated by plugin drivers while loading;
예제 #4
0
파일: quota.py 프로젝트: zioc/neutron
                      'minus for unlimited')),
    cfg.IntOpt('quota_subnet',
               default=10,
               help=_('Number of subnets allowed per tenant, '
                      'minus for unlimited')),
    cfg.IntOpt('quota_port',
               default=50,
               help=_('number of ports allowed per tenant, minus for '
                      'unlimited')),
    cfg.StrOpt('quota_driver',
               default='neutron.quota.ConfDriver',
               help=_('Default driver to use for quota checks')),
]
# Register the configuration options
cfg.CONF.register_opts(quota_opts, 'QUOTAS')
legacy.override_config(cfg.CONF, [('QUOTAS', 'quota_driver')])


class ConfDriver(object):
    """Configuration driver.

    Driver to perform necessary checks to enforce quotas and obtain
    quota information. The default driver utilizes the default values
    in neutron.conf.
    """
    def _get_quotas(self, context, resources, keys):
        """Get quotas.

        A helper method which retrieves the quotas for the specific
        resources identified by keys, and which apply to the current
        context.
예제 #5
0
 def test_override_config_group_key(self):
     self.cfg(args=['--bar-baz=quantum'])
     legacy.override_config(self.cfg, [('bar', 'baz', 'mod')])
     self.assertEqual(self.cfg.bar.baz, 'neutron')
예제 #6
0
 def test_override_config_missing_key(self):
     self.cfg(args=[])
     legacy.override_config(self.cfg, ['foo'])
     self.assertIsNone(self.cfg.foo)
예제 #7
0
 def test_override_config_simple_key_unchanged(self):
     self.cfg(args=['--foo=something.else'])
     legacy.override_config(self.cfg, ['foo'])
     self.assertEqual(self.cfg.foo, 'something.else')
예제 #8
0
 def test_override_config_simple_key(self):
     self.cfg(args=['--foo=quantum'])
     legacy.override_config(self.cfg, ['foo'])
     self.assertEqual(self.cfg.foo, 'neutron')
예제 #9
0
from neutron.plugins.common import constants
from neutron.services.loadbalancer import agent_scheduler

LOG = logging.getLogger(__name__)

DEFAULT_DRIVER = ("neutron.services.loadbalancer.drivers.haproxy"
                  ".plugin_driver.HaproxyOnHostPluginDriver")

lbaas_plugin_opts = [
    cfg.StrOpt('driver_fqn',
               default=DEFAULT_DRIVER,
               help=_('LBaaS driver Fully Qualified Name'))
]

cfg.CONF.register_opts(lbaas_plugin_opts, "LBAAS")
legacy.override_config(cfg.CONF, [('LBAAS', 'driver_fqn')])


class LoadBalancerPlugin(loadbalancer_db.LoadBalancerPluginDb,
                         agent_scheduler.LbaasAgentSchedulerDbMixin):
    """Implementation of the Neutron Loadbalancer Service Plugin.

    This class manages the workflow of LBaaS request/response.
    Most DB related works are implemented in class
    loadbalancer_db.LoadBalancerPluginDb.
    """
    supported_extension_aliases = ["lbaas", "lbaas_agent_scheduler"]

    # lbaas agent notifiers to handle agent update operations;
    # can be updated by plugin drivers while loading;
    # will be extracted by neutron manager when loading service plugins;