Esempio n. 1
0
from oslo_config import cfg
from oslo_config import cfg as oslo_config
import oslo_messaging as messaging
from oslo_serialization import jsonutils

import requests
import six

LOG = nfp_logging.getLogger(__name__)
Version = 'v1'  # v1/v2/v3#

rest_opts = [
    cfg.StrOpt('rest_server_address',
               default='',
               help='Rest connection IpAddr'),
    cfg.IntOpt('rest_server_port', default=8080, help='Rest connection Port'),
]

rpc_opts = [
    cfg.StrOpt('topic', default='', help='Topic for rpc connection'),
]

oslo_config.CONF.register_opts(rest_opts, "REST")
oslo_config.CONF.register_opts(rpc_opts, "RPC")
n_rpc.init(cfg.CONF)

UNIX_REST = 'unix_rest'
TCP_REST = 'tcp_rest'
""" Common Class for restClient exceptions """

Esempio n. 2
0
File: ldap.py Progetto: Boye-Z/123
query_scope = cfg.StrOpt('query_scope',
                         default='one',
                         choices=['one', 'sub'],
                         help=utils.fmt("""
The search scope which defines how deep to search within the search base. A
value of `one` (representing `oneLevel` or `singleLevel`) indicates a search of
objects immediately below to the base object, but does not include the base
object itself. A value of `sub` (representing `subtree` or `wholeSubtree`)
indicates a search of both the base object itself and the entire subtree below
it.
"""))

page_size = cfg.IntOpt('page_size',
                       default=0,
                       min=0,
                       help=utils.fmt("""
Defines the maximum number of results per page that keystone should request
from the LDAP server when listing objects. A value of zero (`0`) disables
paging.
"""))

alias_dereferencing = cfg.StrOpt(
    'alias_dereferencing',
    default='default',
    choices=['never', 'searching', 'always', 'finding', 'default'],
    help=utils.fmt("""
The LDAP dereferencing option to use for queries involving aliases. A value of
`default` falls back to using default dereferencing behavior configured by your
`ldap.conf`. A value of `never` prevents aliases from being dereferenced at
all. A value of `searching` dereferences aliases only after name resolution. A
value of `finding` dereferences aliases only during name resolution. A value of
`always` dereferences aliases in all cases.
Esempio n. 3
0
from oslo_utils import timeutils

from neutron.db import agents_db
from neutron.tests import base
from neutron_lib.agent import topics
from neutron_lib import constants
from neutron_lib import context as neutron_context

from networking_vsphere.common import constants as ovsvapp_const
from networking_vsphere.db import ovsvapp_db
from networking_vsphere.ml2 import ovsvapp_rpc
from networking_vsphere.monitor import ovsvapp_monitor

service_opts = [
    cfg.IntOpt('api_workers',
               help=_('Number of separate API worker processes for service. '
                      'If not specified, the default is equal to the number '
                      'of CPUs available for best performance.')),
]

CONF = cfg.CONF
CONF.register_opts(service_opts)

FAKE_CLUSTER_1 = 'fake_cluster_1'
FAKE_CLUSTER_2 = 'fake_cluster_2'
FAKE_VCENTER = 'fake_vcenter'
FAKE_HOST_1 = 'fake_host_1'
FAKE_HOST_2 = 'fake_host_2'


def make_active_agent(fake_id, fake_agent_type, config=None):
    agent_dict = dict(id=fake_id,
#    under the License.
"""
The VMware API utility module.
"""

from oslo_config import cfg
from oslo_log import log as logging
from oslo_vmware import vim_util as vutil
import six

vmware_opts = cfg.IntOpt('maximum_objects',
                         default=100,
                         help='The maximum number of ObjectContent data '
                         'objects that should be returned in a single '
                         'result. A positive value will cause the '
                         'operation to suspend the retrieval when the '
                         'count of objects reaches the specified '
                         'maximum. The server may still limit the count '
                         'to something less than the configured value. '
                         'Any remaining objects may be retrieved with '
                         'additional requests.')
CONF = cfg.CONF
CONF.register_opt(vmware_opts, 'vmware')
LOG = logging.getLogger(__name__)


def object_to_dict(obj, list_depth=1):
    """Convert Suds object into serializable format.

    The calling function can limit the amount of list entries that
    are converted.
Esempio n. 5
0
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    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

from ironic.common.i18n import _

opts = [
    cfg.IntOpt('workers_pool_size',
               default=100,
               min=3,
               help=_('The size of the workers greenthread pool. '
                      'Note that 2 threads will be reserved by the conductor '
                      'itself for handling heart beats and periodic tasks.')),
    cfg.IntOpt('heartbeat_interval',
               default=10,
               help=_('Seconds between conductor heart beats.')),
    cfg.StrOpt('api_url',
               regex='^http(s?):\/\/.+',
               help=_('URL of Ironic API service. If not set ironic can '
                      'get the current value from the keystone service '
                      'catalog. If set, the value must start with either '
                      'http:// or https://.')),
    cfg.IntOpt('heartbeat_timeout',
               default=60,
               help=_('Maximum time (in seconds) since the last check-in '
                      'of a conductor. A conductor is considered inactive '
Esempio n. 6
0
from designate.i18n import _LW
from designate.i18n import _LE
from designate.network_api import base

CONF = cfg.CONF
LOG = logging.getLogger(__name__)

neutron_opts = [
    cfg.ListOpt('endpoints',
                help='URL to use if None in the ServiceCatalog that is '
                'passed by the request context. Format: <region>|<url>'),
    cfg.StrOpt('endpoint_type',
               default='publicURL',
               help="Endpoint type to use"),
    cfg.IntOpt('timeout',
               default=30,
               help='timeout value for connecting to neutron in seconds'),
    cfg.StrOpt('admin_username',
               help='username for connecting to neutron in admin context'),
    cfg.StrOpt('admin_password',
               help='password for connecting to neutron in admin context',
               secret=True),
    cfg.StrOpt('admin_tenant_name',
               help='tenant name for connecting to neutron in admin context'),
    cfg.StrOpt('auth_url',
               help='auth url for connecting to neutron in admin context'),
    cfg.BoolOpt('insecure',
                default=False,
                help='if set, ignore any SSL validation issues'),
    cfg.StrOpt('auth_strategy',
               default='keystone',
Esempio n. 7
0
TRUSTED_GROUP_NAME = "trusted_computing"
UPGRADE_GROUP_NAME = "upgrade_levels"

host_subset_size_opt = cfg.IntOpt("scheduler_host_subset_size",
                                  default=1,
                                  help="""
New instances will be scheduled on a host chosen randomly from a subset of the
N best hosts, where N is the value set by this option.  Valid values are 1 or
greater. Any value less than one will be treated as 1.

Setting this to a value greater than 1 will reduce the chance that multiple
scheduler processes handling similar requests will select the same host,
creating a potential race condition. By selecting a host randomly from the N
hosts that best fit the request, the chance of a conflict is reduced. However,
the higher you set this value, the less optimal the chosen host may be for a
given request.

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

* Services that use this:

    ``nova-scheduler``

* Related options:

    None
""")

bm_default_filter_opt = cfg.ListOpt("baremetal_scheduler_default_filters",
                                    default=[
Esempio n. 8
0
"""),
    cfg.IntOpt('inject_partition',
               default=-2,
               min=-2,
               help="""
Determines the way how the file system is chosen to inject data into it.

*libguestfs* will be used a first solution to inject data. If that's not
available on the host, the image will be locally mounted on the host as a
fallback solution. If libguestfs is not able to determine the root partition
(because there are more or less than one root partition) or cannot mount the
file system it will result in an error and the instance won't be boot.

Possible values:

* -2 => disable the injection of data.
* -1 => find the root partition with the file system to mount with libguestfs
*  0 => The image is not partitioned
* >0 => The number of the partition to use for the injection

Related options:

* ``inject_key``: If this option allows the injection of a SSH key it depends
  on value greater or equal to -1 for ``inject_partition``.
* ``inject_password``: If this option allows the injection of an admin password
  it depends on value greater or equal to -1 for ``inject_partition``.
* ``guestfs`` You can enable the debug log level of libguestfs with this
  config option. A more verbose output will help in debugging issues.
* ``virt_type``: If you use ``lxc`` as virt_type it will be treated as a
  single partition image
"""),
    cfg.BoolOpt('use_usb_tablet',
Esempio n. 9
0
# Copyright 2013 VMware, Inc.  All rights reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    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

from neutron._i18n import _

allowed_address_pair_opts = [
    #TODO(limao): use quota framework when it support quota for attributes
    cfg.IntOpt('max_allowed_address_pair',
               default=10,
               help=_("Maximum number of allowed address pairs")),
]


def register_allowed_address_pair_opts(cfg=cfg.CONF):
    cfg.register_opts(allowed_address_pair_opts)
Esempio n. 10
0
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
"""Config options for CloudPulse Backend service."""

from oslo_config import cfg

SERVICE_OPTS = [
    cfg.StrOpt('topic',
               default='cloudpulse-conductor',
               help='The queue to add conductor tasks to'),
    cfg.IntOpt('conductor_life_check_timeout',
               default=4,
               help=('RPC timeout for the conductor liveness check that is '
                     'used for bay locking.')),
]

opt_group = cfg.OptGroup(name='conductor',
                         title='Options for the cloudpulse-conductor service')
cfg.CONF.register_group(opt_group)
cfg.CONF.register_opts(SERVICE_OPTS, opt_group)
Esempio n. 11
0
 cfg.ListOpt('osapi_share_ext_list',
             default=[],
             help='Specify list of extensions to load when using osapi_'
             'share_extension option with manila.api.contrib.'
             'select_extensions.'),
 cfg.ListOpt('osapi_share_extension',
             default=['manila.api.contrib.standard_extensions'],
             help='The osapi share extensions to load.'),
 cfg.StrOpt('sqlite_db',
            default='manila.sqlite',
            help='The filename to use with sqlite.'),
 cfg.BoolOpt('sqlite_synchronous',
             default=True,
             help='If passed, use synchronous mode for sqlite.'),
 cfg.IntOpt('sql_idle_timeout',
            default=3600,
            help='Timeout before idle SQL connections are reaped.'),
 cfg.IntOpt('sql_max_retries',
            default=10,
            help='Maximum database connection retries during startup. '
            '(setting -1 implies an infinite retry count).'),
 cfg.IntOpt('sql_retry_interval',
            default=10,
            help='Interval between retries of opening a SQL connection.'),
 cfg.StrOpt('scheduler_manager',
            default='manila.scheduler.manager.SchedulerManager',
            help='Full class name for the scheduler manager.'),
 cfg.StrOpt('share_manager',
            default='manila.share.manager.ShareManager',
            help='Full class name for the share manager.'),
 cfg.StrOpt('data_manager',
Esempio n. 12
0
            help=_('Additional append parameters for baremetal PXE boot.')),
 cfg.StrOpt('default_ephemeral_format',
            default='ext4',
            help=_('Default file system format for ephemeral partition, '
                   'if one is created.')),
 cfg.StrOpt('images_path',
            default='/var/lib/ironic/images/',
            help=_('On the ironic-conductor node, directory where images '
                   'are stored on disk.')),
 cfg.StrOpt('instance_master_path',
            default='/var/lib/ironic/master_images',
            help=_('On the ironic-conductor node, directory where master '
                   'instance images are stored on disk. '
                   'Setting to <None> disables image caching.')),
 cfg.IntOpt('image_cache_size',
            default=20480,
            help=_('Maximum size (in MiB) of cache for master images, '
                   'including those in use.')),
 # 10080 here is 1 week - 60*24*7. It is entirely arbitrary in the absence
 # of a facility to disable the ttl entirely.
 cfg.IntOpt('image_cache_ttl',
            default=10080,
            help=_('Maximum TTL (in minutes) for old master images in '
                   'cache.')),
 cfg.StrOpt('pxe_config_template',
            default=os.path.join('$pybasedir',
                                 'drivers/modules/pxe_config.template'),
            help=_('On ironic-conductor node, template file for PXE '
                   'configuration.')),
 cfg.StrOpt('uefi_pxe_config_template',
            default=os.path.join(
                '$pybasedir', 'drivers/modules/pxe_grub_config.template'),
Esempio n. 13
0
from ceilometer import pipeline
from ceilometer.publisher import utils as publisher_utils
from ceilometer import service_base
from ceilometer import utils

LOG = log.getLogger(__name__)

OPTS = [
    cfg.BoolOpt('batch_polled_samples',
                default=True,
                help='To reduce polling agent load, samples are sent to the '
                'notification agent in a batch. To gain higher '
                'throughput at the cost of load set this to False.'),
    cfg.IntOpt('shuffle_time_before_polling_task',
               default=0,
               help='To reduce large requests at same time to Nova or other '
               'components from different compute agents, shuffle '
               'start time of polling task.'),
]

POLLING_OPTS = [
    cfg.StrOpt('partitioning_group_prefix',
               deprecated_group='central',
               help='Work-load partitioning group prefix. Use only if you '
               'want to run multiple polling agents with different '
               'config files. For each sub-group of the agent '
               'pool with the same partitioning_group_prefix a disjoint '
               'subset of pollsters should be loaded.'),
]

cfg.CONF.register_opts(OPTS)
Esempio n. 14
0
from kuryr_kubernetes import clients
from kuryr_kubernetes import config
from kuryr_kubernetes import constants
from kuryr_kubernetes.controller.drivers import base
from kuryr_kubernetes.controller.drivers import utils as c_utils
from kuryr_kubernetes.controller.managers import pool
from kuryr_kubernetes import exceptions
from kuryr_kubernetes import os_vif_util as ovu
from kuryr_kubernetes import utils

LOG = logging.getLogger(__name__)

# Moved out from neutron_default group
vif_pool_driver_opts = [
    oslo_cfg.IntOpt('ports_pool_max',
                    help=_("Set a maximum amount of ports per pool. "
                           "0 to disable"),
                    default=0),
    oslo_cfg.IntOpt('ports_pool_min',
                    help=_("Set a target minimum size of the pool of ports"),
                    default=5),
    oslo_cfg.IntOpt('ports_pool_batch',
                    help=_("Number of ports to be created in a bulk request"),
                    default=10),
    oslo_cfg.IntOpt('ports_pool_update_frequency',
                    help=_("Minimum interval (in seconds) "
                           "between pool updates"),
                    default=20),
    oslo_cfg.DictOpt('pools_vif_drivers',
                     help=_("Dict with the pool driver and pod driver to be "
                            "used. If not set, it will take them from the "
                            "kubernetes driver options for pool and pod "
Esempio n. 15
0
            default=None,
            help='The network mode for Docker build. Example: host'),
 cfg.BoolOpt('cache',
             default=True,
             help='Use the Docker cache when building'),
 cfg.MultiOpt('profile',
              types.String(),
              short='p',
              help=('Build a pre-defined set of images, see [profiles]'
                    ' section in config. The default profiles are:'
                    ' {}'.format(', '.join(
                        [opt.name for opt in _PROFILE_OPTS])))),
 cfg.BoolOpt('push', default=False, help='Push images after building'),
 cfg.IntOpt('push-threads',
            default=1,
            min=1,
            help=('The number of threads to use while pushing images.'
                  ' Note: Docker cannot handle threaded pushing properly')),
 cfg.IntOpt('retries',
            short='r',
            default=3,
            min=0,
            help='The number of times to retry while building'),
 cfg.MultiOpt('regex',
              types.String(),
              positional=True,
              required=False,
              help=('Build only images matching regex and its'
                    ' dependencies')),
 cfg.StrOpt('registry',
            help=('The docker registry host. The default registry host'
Esempio n. 16
0
BaremetalGroup = [
    cfg.StrOpt('catalog_type',
               default='baremetal',
               help="Catalog type of the baremetal provisioning service"),
    cfg.StrOpt('driver', default='fake', help="Driver name which Ironic uses"),
    cfg.StrOpt('endpoint_type',
               default='publicURL',
               choices=[
                   'public', 'admin', 'internal', 'publicURL', 'adminURL',
                   'internalURL'
               ],
               help="The endpoint type to use for the baremetal provisioning"
               " service"),
    cfg.IntOpt('deploywait_timeout',
               default=15,
               help="Timeout for Ironic node to reach the "
               "wait-callback state after powering on."),
    cfg.IntOpt('active_timeout',
               default=300,
               help="Timeout for Ironic node to completely provision"),
    cfg.IntOpt('association_timeout',
               default=30,
               help="Timeout for association of Nova instance and Ironic "
               "node"),
    cfg.IntOpt('power_timeout',
               default=60,
               help="Timeout for Ironic power transitions."),
    cfg.IntOpt('unprovision_timeout',
               default=300,
               help="Timeout for unprovisioning an Ironic node. "
               "Takes longer since Kilo as Ironic performs an extra "
Esempio n. 17
0
def get_user_opts(uid, gid):
    return [
        cfg.IntOpt('uid', default=uid, help='The user id'),
        cfg.IntOpt('gid', default=gid, help='The group id'),
    ]
Esempio n. 18
0
from magnum.api import config as api_config
from magnum.api import middleware
from magnum.common import config as common_config
from magnum.i18n import _LI

# Register options for the service
API_SERVICE_OPTS = [
    cfg.PortOpt('port',
                default=9511,
                help='The port for the Magnum API server.'),
    cfg.IPOpt('host',
              default='127.0.0.1',
              help='The listen IP for the Magnum API server.'),
    cfg.IntOpt('max_limit',
               default=1000,
               help='The maximum number of items returned in a single '
               'response from a collection resource.'),
    cfg.StrOpt('api_paste_config',
               default="api-paste.ini",
               help="Configuration file for WSGI definition of API."),
    cfg.StrOpt('ssl_cert_file',
               help="This option allows setting path to the SSL certificate "
               "of API server. "),
    cfg.StrOpt('ssl_key_file',
               help="This option specifies the path to the file where SSL "
               "private key of API server is stored when SSL is in "
               "effect. "),
    cfg.BoolOpt('enabled_ssl',
                default=False,
                help='Enable SSL Magnum API service')
]
Esempio n. 19
0
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import service
from oslo_utils import excutils
from oslo_utils import netutils

from miper import exception
from miper.i18n import _, _LE, _LI

socket_opts = [
    cfg.BoolOpt('tcp_keepalive',
                default=True,
                help="Sets the value of TCP_KEEPALIVE (True/False) for each "
                "server socket."),
    cfg.IntOpt('tcp_keepidle',
               default=600,
               help="Sets the value of TCP_KEEPIDLE in seconds for each "
               "server socket. Not supported on OS X."),
    cfg.IntOpt('tcp_keepalive_interval',
               help="Sets the value of TCP_KEEPINTVL in seconds for each "
               "server socket. Not supported on OS X."),
    cfg.IntOpt('tcp_keepalive_count',
               help="Sets the value of TCP_KEEPCNT for each "
               "server socket. Not supported on OS X."),
    cfg.StrOpt('ssl_ca_file',
               default=None,
               help="CA certificate file to use to verify "
               "connecting clients"),
    cfg.StrOpt('ssl_cert_file',
               default=None,
               help="Certificate file to use when starting "
               "the server securely"),
Esempio n. 20
0
LOG = logging.getLogger(__name__)

AGENTS_SCHEDULER_OPTS = [
    cfg.StrOpt('network_scheduler_driver',
               default='neutron.scheduler.'
                       'dhcp_agent_scheduler.WeightScheduler',
               help=_('Driver to use for scheduling network to DHCP agent')),
    cfg.BoolOpt('network_auto_schedule', default=True,
                help=_('Allow auto scheduling networks to DHCP agent.')),
    cfg.BoolOpt('allow_automatic_dhcp_failover', default=True,
                help=_('Automatically remove networks from offline DHCP '
                       'agents.')),
    cfg.IntOpt('dhcp_agents_per_network', default=1,
               help=_('Number of DHCP agents scheduled to host a tenant '
                      'network. If this number is greater than 1, the '
                      'scheduler automatically assigns multiple DHCP agents '
                      'for a given tenant network, providing high '
                      'availability for DHCP service.')),
    cfg.BoolOpt('enable_services_on_agents_with_admin_state_down',
                default=False,
                help=_('Enable services on an agent with admin_state_up '
                       'False. If this option is False, when admin_state_up '
                       'of an agent is turned False, services on it will be '
                       'disabled. Agents with admin_state_up False are not '
                       'selected for automatic scheduling regardless of this '
                       'option. But manual scheduling to such agents is '
                       'available if this option is True.')),
]

cfg.CONF.register_opts(AGENTS_SCHEDULER_OPTS)
Esempio n. 21
0
from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume import volume_utils

LOG = logging.getLogger(__name__)

# FIXME(jdg):  We'll put the lvm_ prefix back on these when we
# move over to using this as the real LVM driver, for now we'll
# rename them so that the config generation utility doesn't barf
# on duplicate entries.
volume_opts = [
    cfg.StrOpt('volume_group',
               default='cinder-volumes',
               help='Name for the VG that will contain exported volumes'),
    cfg.IntOpt('lvm_mirrors',
               default=0,
               help='If >0, create LVs with multiple mirrors. Note that '
               'this requires lvm_mirrors + 2 PVs with available space'),
    cfg.StrOpt('lvm_type',
               default='auto',
               choices=[('default', 'Thick-provisioned LVM.'),
                        ('thin', 'Thin-provisioned LVM.'),
                        ('auto', 'Defaults to thin when supported.')],
               help='Type of LVM volumes to deploy; (default, thin, or auto). '
               'Auto defaults to thin if thin is supported.'),
    cfg.StrOpt('lvm_conf_file',
               default='/etc/cinder/lvm.conf',
               help='LVM conf file to use for the LVM driver in Cinder; '
               'this setting is ignored if the specified file does '
               'not exist (You can also specify \'None\' to not use '
               'a conf file even if one exists).'),
    cfg.BoolOpt('lvm_suppress_fd_warnings',
Esempio n. 22
0
from ceilometer import publisher
from ceilometer.publisher import utils as publisher_utils
from ceilometer import sample as sample_util

OPTS = [
    cfg.StrOpt('pipeline_cfg_file',
               default="pipeline.yaml",
               help="Configuration file for pipeline definition."),
    cfg.StrOpt('event_pipeline_cfg_file',
               default="event_pipeline.yaml",
               help="Configuration file for event pipeline definition."),
    cfg.BoolOpt('refresh_pipeline_cfg',
                default=False,
                help="Refresh Pipeline configuration on-the-fly."),
    cfg.IntOpt('pipeline_polling_interval',
               default=20,
               help="Polling interval for pipeline file configuration"
               " in seconds."),
]

cfg.CONF.register_opts(OPTS)

LOG = log.getLogger(__name__)


class PipelineException(Exception):
    def __init__(self, message, pipeline_cfg):
        self.msg = message
        self.pipeline_cfg = pipeline_cfg

    def __str__(self):
        return 'Pipeline %s: %s' % (self.pipeline_cfg, self.msg)
Esempio n. 23
0
# Copyright 2015 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# 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

cfg.CONF.register_group(cfg.OptGroup(
    name='service:conductor', title="Configuration for Engine Service"
))

cfg.CONF.register_opts([
    cfg.IntOpt('workers', default=3,
               help='Number of central worker processes to spawn'),
    cfg.IntOpt('threads', default=1000,
               help='Number of central greenthreads to spawn'),
], group='service:conductor')
Esempio n. 24
0
LOG = logging.getLogger(__name__)

opts = [
    cfg.StrOpt('admin_username', help='Nova keystone admin name'),
    cfg.StrOpt('admin_password',
               secret=True,
               help='Nova keystone admin password.'),
    cfg.StrOpt('admin_url', help='Keystone public API endpoint.'),
    cfg.StrOpt('client_log_level',
               help='Log level override for novaclient. Set this in '
               'order to override the global "default_log_levels", '
               '"verbose", and "debug" settings.'),
    cfg.StrOpt('admin_tenant_name', help='Nova keystone tenant name.'),
    cfg.IntOpt('api_max_retries',
               default=60,
               help='How many retries when a request does conflict.'),
    cfg.IntOpt('api_retry_interval',
               default=2,
               help='How often to retry in seconds when a request '
               'does conflict'),
    cfg.StrOpt('api_version',
               default='2',
               help='The API version of the nova client to use.'),
    cfg.StrOpt('region_name', help='Nova region name.'),
    cfg.StrOpt('service_name', help='Nova service name.'),
    cfg.StrOpt('auth_system',
               default='keystone',
               help='Nova auth_system argument.'),
    cfg.StrOpt('auth_plugin',
               help='The authorization plugin to load for nova.'),
Esempio n. 25
0
from ceilometer.api import rbac
from ceilometer.i18n import _
from ceilometer import messaging
from ceilometer.openstack.common import log
from ceilometer import utils

LOG = log.getLogger(__name__)


ALARM_API_OPTS = [
    cfg.BoolOpt('record_history',
                default=True,
                help='Record alarm change events.'
                ),
    cfg.IntOpt('user_alarm_quota',
               default=None,
               help='Maximum number of alarms defined for a user.'
               ),
    cfg.IntOpt('project_alarm_quota',
               default=None,
               help='Maximum number of alarms defined for a project.'
               ),
]

cfg.CONF.register_opts(ALARM_API_OPTS, group='alarm')

state_kind = ["ok", "alarm", "insufficient data"]
state_kind_enum = wtypes.Enum(str, *state_kind)
severity_kind = ["low", "moderate", "critical"]
severity_kind_enum = wtypes.Enum(str, *severity_kind)

Esempio n. 26
0
def register_volume():
    volume_opts = [
        cfg.IntOpt(
            'num_shell_tries',
            default=3,
            help='Number of times to attempt to run flakey shell commands'),
        cfg.IntOpt('reserved_percentage',
                   default=0,
                   min=0,
                   max=100,
                   help='The percentage of backend capacity is reserved'),
        cfg.StrOpt('iscsi_target_prefix',
                   default='iqn.2010-10.org.openstack:',
                   help='Prefix for iSCSI volumes'),
        cfg.StrOpt(
            'iscsi_ip_address',
            default='$my_ip',
            help='The IP address that the iSCSI daemon is listening on'),
        cfg.ListOpt(
            'iscsi_secondary_ip_addresses',
            default=[],
            help='The list of secondary IP addresses of the iSCSI daemon'),
        cfg.PortOpt('iscsi_port',
                    default=3260,
                    help='The port that the iSCSI daemon is listening on'),
        cfg.IntOpt('num_volume_device_scan_tries',
                   default=3,
                   help='The maximum number of times to rescan targets'
                   ' to find volume'),
        cfg.StrOpt('volume_backend_name',
                   help='The backend name for a given driver implementation'),
        cfg.BoolOpt(
            'use_multipath_for_image_xfer',
            default=False,
            help='Do we attach/detach volumes in cinder using multipath '
            'for volume to image and image to volume transfers?'),
        cfg.BoolOpt('enforce_multipath_for_image_xfer',
                    default=False,
                    help='If this is set to True, attachment of volumes for '
                    'image transfer will be aborted when multipathd is not '
                    'running. Otherwise, it will fallback to single path.'),
        cfg.StrOpt('volume_clear',
                   default='zero',
                   choices=['none', 'zero', 'shred'],
                   help='Method used to wipe old volumes'),
        cfg.IntOpt(
            'volume_clear_size',
            default=0,
            help='Size in MiB to wipe at start of old volumes. 0 => all'),
        cfg.StrOpt('volume_clear_ionice',
                   help='The flag to pass to ionice to alter the i/o priority '
                   'of the process used to zero a volume after deletion, '
                   'for example "-c3" for idle only priority.'),
        cfg.StrOpt(
            'iscsi_helper',
            default='tgtadm',
            choices=[
                'tgtadm', 'lioadm', 'scstadmin', 'iseradm', 'iscsictl',
                'ietadm', 'fake'
            ],
            help='iSCSI target user-land tool to use. tgtadm is default, '
            'use lioadm for LIO iSCSI support, scstadmin for SCST '
            'target support, iseradm for the ISER protocol, ietadm '
            'for iSCSI Enterprise Target, iscsictl for Chelsio iSCSI '
            'Target or fake for testing.'),
        cfg.StrOpt('volumes_dir',
                   default='$state_path/volumes',
                   help='Volume configuration file storage '
                   'directory'),
        cfg.StrOpt('iet_conf',
                   default='/etc/iet/ietd.conf',
                   help='IET configuration file'),
        cfg.StrOpt('chiscsi_conf',
                   default='/etc/chelsio-iscsi/chiscsi.conf',
                   help='Chiscsi (CXT) global defaults configuration file'),
        cfg.StrOpt('iscsi_iotype',
                   default='fileio',
                   choices=['blockio', 'fileio', 'auto'],
                   help=('Sets the behavior of the iSCSI target '
                         'to either perform blockio or fileio '
                         'optionally, auto can be set and Cinder '
                         'will autodetect type of backing device')),
        cfg.StrOpt('volume_dd_blocksize',
                   default='1M',
                   help='The default block size used when copying/clearing '
                   'volumes'),
        cfg.StrOpt('volume_copy_blkio_cgroup_name',
                   default='cinder-volume-copy',
                   help='The blkio cgroup name to be used to limit bandwidth '
                   'of volume copy'),
        cfg.IntOpt('volume_copy_bps_limit',
                   default=0,
                   help='The upper limit of bandwidth of volume copy. '
                   '0 => unlimited'),
        cfg.StrOpt('iscsi_write_cache',
                   default='on',
                   choices=['on', 'off'],
                   help='Sets the behavior of the iSCSI target to either '
                   'perform write-back(on) or write-through(off). '
                   'This parameter is valid if iscsi_helper is set '
                   'to tgtadm or iseradm.'),
        cfg.StrOpt('iscsi_target_flags',
                   default='',
                   help='Sets the target-specific flags for the iSCSI target. '
                   'Only used for tgtadm to specify backing device flags '
                   'using bsoflags option. The specified string is passed '
                   'as is to the underlying tool.'),
        cfg.StrOpt('iscsi_protocol',
                   default='iscsi',
                   choices=['iscsi', 'iser'],
                   help='Determines the iSCSI protocol for new iSCSI volumes, '
                   'created with tgtadm or lioadm target helpers. In '
                   'order to enable RDMA, this parameter should be set '
                   'with the value "iser". The supported iSCSI protocol '
                   'values are "iscsi" and "iser".'),
        cfg.StrOpt(
            'driver_client_cert_key',
            help='The path to the client certificate key for verification, '
            'if the driver supports it.'),
        cfg.StrOpt('driver_client_cert',
                   help='The path to the client certificate for verification, '
                   'if the driver supports it.'),
        cfg.BoolOpt('driver_use_ssl',
                    default=False,
                    help='Tell driver to use SSL for connection to backend '
                    'storage if the driver supports it.'),
        cfg.FloatOpt(
            'max_over_subscription_ratio',
            default=3.0,
            help='Float representation of the over subscription ratio '
            'when thin provisioning is involved. Default ratio is '
            '3.0, meaning provisioned capacity can be 3 times of '
            'the total physical capacity. If the ratio is 10.5, it '
            'means provisioned capacity can be 10.5 times of the '
            'total physical capacity. A ratio of 1.0 means '
            'provisioned capacity cannot exceed the total physical '
            'capacity. The ratio has to be a minimum of 1.0.'),
        cfg.StrOpt('scst_target_iqn_name',
                   help='Certain ISCSI targets have predefined target names, '
                   'SCST target driver uses this name.'),
        cfg.StrOpt('scst_target_driver',
                   default='iscsi',
                   help='SCST target implementation can choose from multiple '
                   'SCST target drivers.'),
        cfg.BoolOpt('use_chap_auth',
                    default=False,
                    help='Option to enable/disable CHAP authentication for '
                    'targets.',
                    deprecated_opts=deprecated_use_chap_auth_opts),
        cfg.StrOpt('chap_username',
                   default='',
                   help='CHAP user name.',
                   deprecated_opts=deprecated_chap_username_opts),
        cfg.StrOpt('chap_password',
                   default='',
                   help='Password for specified CHAP account name.',
                   deprecated_opts=deprecated_chap_password_opts,
                   secret=True),
        cfg.StrOpt('driver_data_namespace',
                   help='Namespace for driver private data values to be '
                   'saved in.'),
        cfg.StrOpt('filter_function',
                   help='String representation for an equation that will be '
                   'used to filter hosts. Only used when the driver '
                   'filter is set to be used by the Cinder scheduler.'),
        cfg.StrOpt('goodness_function',
                   help='String representation for an equation that will be '
                   'used to determine the goodness of a host. Only used '
                   'when using the goodness weigher is set to be used by '
                   'the Cinder scheduler.'),
        cfg.BoolOpt(
            'driver_ssl_cert_verify',
            default=False,
            help='If set to True the http client will validate the SSL '
            'certificate of the backend endpoint.'),
        cfg.StrOpt('driver_ssl_cert_path',
                   help='Can be used to specify a non default path to a '
                   'CA_BUNDLE file or directory with certificates of '
                   'trusted CAs, which will be used to validate the backend'),
        cfg.ListOpt('trace_flags',
                    help='List of options that control which trace info '
                    'is written to the DEBUG log level to assist '
                    'developers. Valid values are method and api.'),
        cfg.MultiOpt(
            'replication_device',
            item_type=types.Dict(),
            secret=True,
            help="Multi opt of dictionaries to represent a replication "
            "target device.  This option may be specified multiple "
            "times in a single config section to specify multiple "
            "replication target devices.  Each entry takes the "
            "standard dict config form: replication_device = "
            "target_device_id:<required>,"
            "key1:value1,key2:value2..."),
        cfg.BoolOpt('image_upload_use_cinder_backend',
                    default=False,
                    help='If set to True, upload-to-image in raw format will '
                    'create a cloned volume and register its location to '
                    'the image service, instead of uploading the volume '
                    'content. The cinder backend and locations support '
                    'must be enabled in the image service, and '
                    'glance_api_version must be set to 2.'),
        cfg.BoolOpt('image_upload_use_internal_tenant',
                    default=False,
                    help='If set to True, the image volume created by '
                    'upload-to-image will be placed in the internal tenant. '
                    'Otherwise, the image volume is created in the current '
                    'context\'s tenant.'),
        cfg.BoolOpt('image_volume_cache_enabled',
                    default=False,
                    help='Enable the image volume cache for this backend.'),
        cfg.IntOpt(
            'image_volume_cache_max_size_gb',
            default=0,
            help='Max size of the image volume cache for this backend in '
            'GB. 0 => unlimited.'),
        cfg.IntOpt(
            'image_volume_cache_max_count',
            default=0,
            help='Max number of entries allowed in the image volume cache. '
            '0 => unlimited.'),
        cfg.BoolOpt(
            'report_discard_supported',
            default=False,
            help='Report to clients of Cinder that the backend supports '
            'discard (aka. trim/unmap). This will not actually '
            'change the behavior of the backend or the client '
            'directly, it will only notify that it can be used.'),
    ]

    # _option_group = 'oslo_reports'
    # conf.register_opts(_options, group=_option_group)
    CONF.register_opts(volume_opts, group="normal")
Esempio n. 27
0
    * None

""")),
]

socket_opts = [
    cfg.IntOpt('backlog',
               default=4096,
               min=1,
               help=_("""
Set the number of incoming connection requests.

Provide a positive integer value to limit the number of requests in
the backlog queue. The default queue size is 4096.

An incoming connection to a TCP listener socket is queued before a
connection can be established with the server. Setting the backlog
for a TCP socket ensures a limited queue size for incoming traffic.

Possible values:
    * Positive integer

Related options:
    * None

""")),
    cfg.IntOpt('tcp_keepidle',
               default=600,
               min=1,
               help=_("""
Set the wait time before a connection recheck.
Esempio n. 28
0
from neutron.i18n import _LE, _LI, _LW
from neutron.plugins.common import constants

# Default timeout for ovs-vsctl command
DEFAULT_OVS_VSCTL_TIMEOUT = 10

# Special return value for an invalid OVS ofport
INVALID_OFPORT = -1
UNASSIGNED_OFPORT = []

# OVS bridge fail modes
FAILMODE_SECURE = 'secure'

OPTS = [
    cfg.IntOpt('ovs_vsctl_timeout',
               default=DEFAULT_OVS_VSCTL_TIMEOUT,
               help=_('Timeout in seconds for ovs-vsctl commands')),
]
cfg.CONF.register_opts(OPTS)

LOG = logging.getLogger(__name__)


def _ofport_result_pending(result):
    """Return True if ovs-vsctl indicates the result is still pending."""
    # ovs-vsctl can return '[]' for an ofport that has not yet been assigned
    try:
        int(result)
        return False
    except (ValueError, TypeError):
        return True
    # NOTE(czarneckia) default by reference does not work with ListOpt
    cfg.ListOpt('uri',
                help='Comma separated list of Kafka broker host:port',
                default=['127.0.0.1:9092'],
                item_type=types.HostAddressPortType()),
    cfg.StrOpt('group_id',
               help='Kafka Group from which persister get data',
               default='1_alarm-state-transitions'),
    cfg.StrOpt('topic',
               help='Kafka Topic from which persister get data',
               default='alarm-state-transitions'),
    cfg.StrOpt('zookeeper_path',
               help='Path in zookeeper for kafka consumer group partitioning algorithm',
               default='/persister_partitions/$kafka_alarm_history.topic'),
    cfg.IntOpt(
        'batch_size',
        help='Maximum number of alarm state history messages to buffer before writing to database',
        default=1),
]


# Replace Default OPt with reference to kafka group option
kafka_common_opts = copy.deepcopy(kafka_common.kafka_common_opts)
for opt in kafka_common_opts:
    opt.default = '$kafka.{}'.format(opt.name)


def register_opts(conf):
    conf.register_group(kafka_alarm_history_group)
    conf.register_opts(kafka_alarm_history_opts + kafka_common_opts,
                       kafka_alarm_history_group)
Esempio n. 30
0
 def __init__(self, config):
     super(GlobalOptions, self).__init__(config, group="DEFAULT")
     self._options = [
         cfg.BoolOpt('allow_reboot',
                     default=True,
                     help='Allows OS reboots requested by plugins'),
         cfg.BoolOpt(
             'stop_service_on_exit',
             default=True,
             help='In case of execution as a service, specifies if the '
             'service must be gracefully stopped before exiting'),
         cfg.BoolOpt(
             'check_latest_version',
             default=True,
             help='Check if there is a newer version of cloudbase-init '
             'available.  If this option is activated, a log '
             'message  will be  emitted if there is a newer version '
             'available.'),
         cfg.IntOpt('retry_count',
                    default=5,
                    help='Max. number of attempts for fetching metadata in '
                    'case of transient errors'),
         cfg.FloatOpt(
             'retry_count_interval',
             default=4,
             help='Interval between attempts in case of transient errors, '
             'expressed in seconds'),
         cfg.StrOpt(
             'mtools_path',
             default=None,
             help='Path to "mtools" program suite, used for interacting '
             'with VFAT filesystems'),
         cfg.StrOpt(
             'bsdtar_path',
             default='bsdtar.exe',
             help='Path to "bsdtar", used to extract ISO ConfigDrive '
             'files'),
         cfg.BoolOpt(
             'netbios_host_name_compatibility',
             default=True,
             help='Truncates the hostname to 15 characters for Netbios '
             'compatibility'),
         cfg.StrOpt('logging_serial_port_settings',
                    default=None,
                    help='Serial port logging settings. Format: '
                    '"port,baudrate,parity,bytesize", e.g.: '
                    '"COM1,115200,N,8". Set to None (default) to disable.'),
         cfg.BoolOpt('activate_windows',
                     default=False,
                     help='Activates Windows automatically'),
         cfg.BoolOpt('winrm_enable_basic_auth',
                     default=True,
                     help='Enables basic authentication for the WinRM '
                     'HTTPS listener'),
         cfg.ListOpt(
             'volumes_to_extend',
             default=None,
             help='List of volumes that need to be extended '
             'if contiguous space is available on the disk. '
             'By default all the available volumes can be extended. '
             'Volumes must be specified using a comma separated list '
             'of volume indexes, e.g.: "1,2"'),
         cfg.StrOpt(
             'local_scripts_path',
             default=None,
             help='Path location containing scripts to be executed when '
             'the plugin runs'),
         cfg.BoolOpt(
             'mtu_use_dhcp_config',
             default=True,
             help='Configures the network interfaces MTU based on the '
             'values provided via DHCP'),
         cfg.StrOpt('username',
                    default='Admin',
                    help='User to be added to the '
                    'system or updated if already existing'),
         cfg.ListOpt(
             'groups',
             default=['Administrators'],
             help='List of local groups to which the user specified in '
             '"username" will be added'),
         cfg.StrOpt(
             'heat_config_dir',
             default='C:\\cfn',
             help='The directory where the Heat configuration files must '
             'be saved'),
         cfg.BoolOpt(
             'ntp_use_dhcp_config',
             default=False,
             help='Configures NTP client time synchronization using '
             'the NTP servers provided via DHCP'),
         cfg.BoolOpt('inject_user_password',
                     default=True,
                     help='Set the password provided in the configuration. '
                     'If False or no password is provided, a random one '
                     'will be set'),
         cfg.StrOpt(
             'first_logon_behaviour',
             default=constant.CLEAR_TEXT_INJECTED_ONLY,
             choices=constant.LOGON_PASSWORD_CHANGE_OPTIONS,
             help='Control the behaviour of what happens at '
             'next logon. If this option is set to `always`, '
             'then the user will be forced to change the password '
             'at next logon. If it is set to '
             '`clear_text_injected_only`, '
             'then the user will have to change the password only if '
             'the password is a clear text password, coming from the '
             'metadata. The last option is `no`, when the user is '
             'never forced to change the password.'),
         cfg.BoolOpt(
             'reset_service_password',
             default=True,
             help='If set to True, the service user password will be '
             'reset at each execution with a new random value of '
             'appropriate length and complexity, unless the user is '
             'a built-in or domain account.'
             'This is needed to avoid "pass the hash" attacks on '
             'Windows cloned instances.'),
         cfg.ListOpt(
             'metadata_services',
             default=[
                 'cloudbaseinit.metadata.services.httpservice.HttpService',
                 'cloudbaseinit.metadata.services'
                 '.configdrive.ConfigDriveService',
                 'cloudbaseinit.metadata.services.ec2service.EC2Service',
                 'cloudbaseinit.metadata.services'
                 '.maasservice.MaaSHttpService',
                 'cloudbaseinit.metadata.services.cloudstack.CloudStack',
                 'cloudbaseinit.metadata.services'
                 '.opennebulaservice.OpenNebulaService',
             ],
             help='List of enabled metadata service classes, '
             'to be tested for availability in the provided order. '
             'The first available service will be used to retrieve '
             'metadata'),
         cfg.ListOpt(
             'plugins',
             default=[
                 'cloudbaseinit.plugins.common.mtu.MTUPlugin',
                 'cloudbaseinit.plugins.windows.ntpclient'
                 '.NTPClientPlugin',
                 'cloudbaseinit.plugins.common.sethostname'
                 '.SetHostNamePlugin',
                 'cloudbaseinit.plugins.windows.createuser'
                 '.CreateUserPlugin',
                 'cloudbaseinit.plugins.common.networkconfig'
                 '.NetworkConfigPlugin',
                 'cloudbaseinit.plugins.windows.licensing'
                 '.WindowsLicensingPlugin',
                 'cloudbaseinit.plugins.common.sshpublickeys'
                 '.SetUserSSHPublicKeysPlugin',
                 'cloudbaseinit.plugins.windows.extendvolumes'
                 '.ExtendVolumesPlugin',
                 'cloudbaseinit.plugins.common.userdata.UserDataPlugin',
                 'cloudbaseinit.plugins.common.setuserpassword.'
                 'SetUserPasswordPlugin',
                 'cloudbaseinit.plugins.windows.winrmlistener.'
                 'ConfigWinRMListenerPlugin',
                 'cloudbaseinit.plugins.windows.winrmcertificateauth.'
                 'ConfigWinRMCertificateAuthPlugin',
                 'cloudbaseinit.plugins.common.localscripts'
                 '.LocalScriptsPlugin',
             ],
             help='List of enabled plugin classes, '
             'to be executed in the provided order'),
         cfg.ListOpt(
             'user_data_plugins',
             default=[
                 'cloudbaseinit.plugins.common.userdataplugins.parthandler.'
                 'PartHandlerPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins.cloudconfig.'
                 'CloudConfigPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins'
                 '.cloudboothook.CloudBootHookPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins.shellscript.'
                 'ShellScriptPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins'
                 '.multipartmixed.MultipartMixedPlugin',
                 'cloudbaseinit.plugins.common.userdataplugins.heat.'
                 'HeatPlugin',
             ],
             help='List of enabled userdata content plugins'),
         cfg.ListOpt(
             'cloud_config_plugins',
             default=[],
             help='List which contains the name of the cloud config '
             'plugins ordered by priority.'),
     ]