コード例 #1
0
ファイル: manager.py プロジェクト: cfiehe/barbican
_PLUGIN_MANAGER = None
_PLUGIN_MANAGER_LOCK = threading.RLock()

CONF = config.new_config()

DEFAULT_PLUGIN_NAMESPACE = 'barbican.crypto.plugin'
DEFAULT_PLUGINS = ['simple_crypto']

crypto_opt_group = cfg.OptGroup(name='crypto', title='Crypto Plugin Options')
crypto_opts = [
    cfg.StrOpt('namespace',
               default=DEFAULT_PLUGIN_NAMESPACE,
               help=u._('Extension namespace to search for plugins.')),
    cfg.MultiStrOpt('enabled_crypto_plugins',
                    default=DEFAULT_PLUGINS,
                    help=u._('List of crypto plugins to load.'))
]
CONF.register_group(crypto_opt_group)
CONF.register_opts(crypto_opts, group=crypto_opt_group)
config.parse_args(CONF)

config.set_module_config("crypto", CONF)


class _CryptoPluginManager(named.NamedExtensionManager):
    def __init__(self, conf=CONF, invoke_args=(), invoke_kwargs={}):
        """Crypto Plugin Manager

        Each time this class is initialized it will load a new instance
        of each enabled crypto plugin. This is undesirable, so rather than
コード例 #2
0
ファイル: pci.py プロジェクト: runzexia/openstack-daocloud-px
pci_opts = [
    cfg.MultiStrOpt('alias',
                    default=[],
                    deprecated_name='pci_alias',
                    deprecated_group='DEFAULT',
                    help="""
An alias for a PCI passthrough device requirement.

This allows users to specify the alias in the extra_spec for a flavor, without
needing to repeat all the PCI property requirements.

Possible Values:

* A list of JSON values which describe the aliases. For example:

    alias = {
      "name": "QuickAssist",
      "product_id": "0443",
      "vendor_id": "8086",
      "device_type": "type-PCI"
    }

  defines an alias for the Intel QuickAssist card. (multi valued). Valid key
  values are :

  * "name": Name of the PCI alias.
  * "product_id": Product ID of the device in hexadecimal.
  * "vendor_id": Vendor ID of the device in hexadecimal.
  * "device_type": Type of PCI device. Valid values are: "type-PCI",
    "type-PF" and "type-VF".
"""),
    cfg.MultiStrOpt('passthrough_whitelist',
コード例 #3
0
import stevedore

from neutron.common import exceptions as n_exc
from neutron.common import repos
from neutron.i18n import _LW
from neutron.openstack.common import log as logging
from neutron.plugins.common import constants

LOG = logging.getLogger(__name__)

SERVICE_PROVIDERS = 'neutron.service_providers'

serviceprovider_opts = [
    cfg.MultiStrOpt('service_provider',
                    default=[],
                    help=_('Defines providers for advanced services '
                           'using the format: '
                           '<service_type>:<name>:<driver>[:default]'))
]

cfg.CONF.register_opts(serviceprovider_opts, 'service_providers')


#global scope function that should be used in service APIs
def normalize_provider_name(name):
    return name.lower()


def get_provider_driver_class(driver, namespace=SERVICE_PROVIDERS):
    """Return path to provider driver class
コード例 #4
0
from oslo_log import log
from oslo_config import cfg

from keystone.auth import plugins as auth_plugins
from keystone.auth.plugins import password
from keystone import exception
from keystone.i18n import _

METHOD_NAME = 'password'

LOG = log.getLogger(__name__)

whitelist_ops = [
    cfg.MultiStrOpt('password_whitelist',
                    default=[],
                    help='user:ip range permitted to use password auth.'
                    'also supports a simple one-character * wildcard'
                    'for user.'),
]

CONF = cfg.CONF
CONF.register_opts(whitelist_ops, group='auth')


def check_whitelist(user_id, remote_addr):
    """Return True if the user_id/remote_addr combination is in our whitelist.
       Otherwise, return raise Unauthorized"""
    LOG.debug("Auth request for user %s from %s" % (user_id, remote_addr))

    for entry in CONF.auth.password_whitelist:
        user, subnet = entry.split(':', 1)
コード例 #5
0
Related options:

* ``compute_driver``: Only the libvirt driver uses this option.
"""),
# NOTE(yamahata): ListOpt won't work because the command may include a comma.
# For example:
#
#     mkfs.ext4 -O dir_index,extent -E stride=8,stripe-width=16
#       --label %(fs_label)s %(target)s
#
# list arguments are comma separated and there is no way to escape such
# commas.
    cfg.MultiStrOpt('virt_mkfs',
        default=[],
        help="""
Name of the mkfs commands for ephemeral device.

The format is <os_type>=<mkfs command>
"""),
    cfg.BoolOpt('resize_fs_using_block_device',
        default=False,
        help="""
Enable resizing of filesystems via a block device.

If enabled, attempt to resize the filesystem by accessing the image over a
block device. This is done by the host and may not be necessary if the image
contains a recent version of cloud-init. Possible mechanisms require the nbd
driver (for qcow and raw), or loop (for raw).
"""),
    cfg.IntOpt('timeout_nbd',
        default=10,
コード例 #6
0
ファイル: api.py プロジェクト: MarioCarrilloA/config
import six

from oslo_config import cfg

from sysinv.openstack.common import context
from sysinv.openstack.common.gettextutils import _
from sysinv.openstack.common import importutils
from sysinv.openstack.common import jsonutils
from sysinv.openstack.common import log as logging
from sysinv.openstack.common import timeutils

LOG = logging.getLogger(__name__)

notifier_opts = [
    cfg.MultiStrOpt('notification_driver',
                    default=[],
                    help='Driver or drivers to handle sending notifications'),
    cfg.StrOpt('default_notification_level',
               default='INFO',
               help='Default notification level for outgoing notifications'),
    cfg.StrOpt('default_publisher_id',
               default='$host',
               help='Default publisher_id for outgoing notifications'),
]

CONF = cfg.CONF
CONF.register_opts(notifier_opts)

WARN = 'WARN'
INFO = 'INFO'
ERROR = 'ERROR'
コード例 #7
0
from barbican.plugin.util import utils as plugin_utils

_SECRET_STORE = None

CONF = config.new_config()
DEFAULT_PLUGIN_NAMESPACE = 'barbican.secretstore.plugin'
DEFAULT_PLUGINS = ['store_crypto']

store_opt_group = cfg.OptGroup(name='secretstore',
                               title='Secret Store Plugin Options')
store_opts = [
    cfg.StrOpt('namespace',
               default=DEFAULT_PLUGIN_NAMESPACE,
               help=u._('Extension namespace to search for plugins.')),
    cfg.MultiStrOpt('enabled_secretstore_plugins',
                    default=DEFAULT_PLUGINS,
                    help=u._('List of secret store plugins to load.'))
]
CONF.register_group(store_opt_group)
CONF.register_opts(store_opts, group=store_opt_group)
config.parse_args(CONF)


class SecretStorePluginNotFound(exception.BarbicanHTTPException):
    """Raised when no plugins are installed."""

    client_message = u._("No plugin was found that could support your request")
    status_code = 400

    def __init__(self, plugin_name=None):
        if plugin_name:
コード例 #8
0
** 'chance_scheduler', which simply picks a host at random
** A custom scheduler driver. In this case, you will be responsible for
   creating and maintaining the entry point in your 'setup.cfg' file
"""),
    cfg.MultiStrOpt("available_filters",
                    default=["zun.scheduler.filters.all_filters"],
                    help="""
Filters that the scheduler can use.

An unordered list of the filter classes the zun scheduler may apply.  Only the
filters specified in the 'scheduler_enabled_filters' option will be used, but
any filter appearing in that option must also be included in this list.

By default, this is set to all filters that are included with zun.

This option is only used by the FilterScheduler and its subclasses; if you use
a different scheduler, this option has no effect.

Possible values:

* A list of zero or more strings, where each string corresponds to the name of
  a filter that may be used for selecting a host

Related options:

* scheduler_enabled_filters
"""),
    cfg.ListOpt("enabled_filters",
                default=[
                    "AvailabilityZoneFilter",
                    "CPUFilter",