help='Certificate chain for SSL validation.'), cfg.StrOpt('os-auth-url', deprecated_group="DEFAULT", default=os.environ.get('OS_AUTH_URL', 'http://localhost:5000/v2.0'), help='Auth URL to use for OpenStack service access.'), cfg.StrOpt('os-region-name', deprecated_group="DEFAULT", default=os.environ.get('OS_REGION_NAME'), help='Region name to use for OpenStack service endpoints.'), cfg.StrOpt('os-endpoint-type', default=os.environ.get('OS_ENDPOINT_TYPE', 'publicURL'), help='Type of endpoint in Identity service catalog to use for ' 'communication with OpenStack services.'), cfg.BoolOpt('insecure', default=False, help='Disables X.509 certificate validation when an ' 'SSL connection to Identity Service is established.'), ] cfg.CONF.register_cli_opts(CLI_OPTIONS, group="service_credentials") cfg.CONF.import_opt('default_log_levels', 'ceilometer.openstack.common.log') LOG = log.getLogger(__name__) class WorkerException(Exception): """Exception for errors relating to service workers.""" def get_workers(name): workers = (cfg.CONF.get('%s_workers' % name) or utils.cpu_count())
vlan_opts = [ cfg.StrOpt('tenant_network_type', default='local', help=_("Network type for tenant networks " "(local, vlan, or none)")), cfg.ListOpt('network_vlan_ranges', default=DEFAULT_VLAN_RANGES, help=_("List of <physical_network>:<vlan_min>:<vlan_max> " "or <physical_network>")), ] vxlan_opts = [ cfg.BoolOpt('enable_vxlan', default=False, help=_("Enable VXLAN on the agent. Can be enabled when " "agent is managed by ml2 plugin using linuxbridge " "mechanism driver")), cfg.IntOpt('ttl', help=_("TTL for vxlan interface protocol packets.")), cfg.IntOpt('tos', help=_("TOS for vxlan interface protocol packets.")), cfg.StrOpt('vxlan_group', default=DEFAULT_VXLAN_GROUP, help=_("Multicast group for vxlan interface.")), cfg.StrOpt('local_ip', default='', help=_("Local IP address of the VXLAN endpoints.")), cfg.BoolOpt('l2_population', default=False, help=_("Extension to use alongside ml2 plugin's l2population " "mechanism driver. It enables the plugin to populate " "VXLAN forwarding table.")),
_LW = i18n._LW # NOTE: positional arguments <args> will be parsed before <command> until # this bug is corrected https://bugs.launchpad.net/oslo.config/+bug/1392428 cli_opts = [ cfg.IntOpt('chunksize', short='c', default=65536, help="Amount of data to transfer per HTTP write."), cfg.StrOpt('dontreplicate', short='D', default=('created_at date deleted_at location updated_at'), help="List of fields to not replicate."), cfg.BoolOpt('metaonly', short='m', default=False, help="Only replicate metadata, not images."), cfg.StrOpt('token', short='t', default='', help=("Pass in your authentication token if you have " "one. If you use this option the same token is " "used for both the master and the slave.")), cfg.StrOpt('mastertoken', short='M', default='', help=("Pass in your authentication token if you have " "one. This is the token used for the master.")), cfg.StrOpt('slavetoken', short='S', default='',
from nova.openstack.common import uuidutils from nova import quota from nova import rpc from nova import servicegroup from nova import utils LOG = logging.getLogger(__name__) QUOTAS = quota.QUOTAS floating_opts = [ cfg.StrOpt('default_floating_pool', default='nova', help='Default pool for floating IPs'), cfg.BoolOpt('auto_assign_floating_ip', default=False, help='Autoassigning floating IP to VM'), cfg.StrOpt('floating_ip_dns_manager', default='nova.network.noop_dns_driver.NoopDNSDriver', help='Full class name for the DNS Manager for floating IPs'), cfg.StrOpt('instance_dns_manager', default='nova.network.noop_dns_driver.NoopDNSDriver', help='Full class name for the DNS Manager for instance IPs'), cfg.StrOpt('instance_dns_domain', default='', help='Full class name for the DNS Zone for instance IPs'), ] CONF = cfg.CONF CONF.register_opts(floating_opts) CONF.import_opt('public_interface', 'nova.network.linux_net')
r'(%(key)s\s*[=]\s*[\"\']).*?([\"\'])', r'(<%(key)s>).*?(</%(key)s>)', r'([\"\']%(key)s[\"\']\s*:\s*[\"\']).*?([\"\'])', r'([\'"].*?%(key)s[\'"]\s*:\s*u?[\'"]).*?([\'"])', r'([\'"].*?%(key)s[\'"]\s*,\s*\'--?[A-z]+\'\s*,\s*u?[\'"])' '.*?([\'"])', r'(%(key)s\s*--?[A-z]+\s*).*?([\s])' ] for key in _SANITIZE_KEYS: for pattern in _FORMAT_PATTERNS: reg_ex = re.compile(pattern % {'key': key}, re.DOTALL) _SANITIZE_PATTERNS.append(reg_ex) common_cli_opts = [ cfg.BoolOpt('debug', short='d', default=False, help='Print debugging output (set logging level to ' 'DEBUG instead of default WARNING level).'), cfg.BoolOpt('verbose', short='v', default=False, help='Print more verbose output (set logging level to ' 'INFO instead of default WARNING level).'), ] logging_cli_opts = [ cfg.StrOpt('log-config-append', metavar='PATH', deprecated_name='log-config', help='The name of a logging configuration file. This file ' 'is appended to any existing logging configuration '
class MetadataProxyHandler(object): OPTS = [ cfg.StrOpt('admin_user', help=_("Admin user")), cfg.StrOpt('admin_password', help=_("Admin password"), secret=True), cfg.StrOpt('admin_tenant_name', help=_("Admin tenant name")), cfg.StrOpt('auth_url', help=_("Authentication URL")), cfg.StrOpt('auth_strategy', default='keystone', help=_("The type of authentication to use")), cfg.StrOpt('auth_region', help=_("Authentication region")), cfg.BoolOpt('auth_insecure', default=False, help=_("Turn off verification of the certificate for" " ssl")), cfg.StrOpt('auth_ca_cert', default=None, help=_("Certificate Authority public key (CA cert) " "file for ssl")), cfg.StrOpt('endpoint_type', default='adminURL', help=_("Network service endpoint type to pull from " "the keystone catalog")), cfg.StrOpt('nova_metadata_ip', default='127.0.0.1', help=_("IP address used by Nova metadata server.")), cfg.IntOpt('nova_metadata_port', default=8775, help=_("TCP Port used by Nova metadata server.")), cfg.StrOpt('metadata_proxy_shared_secret', default='', help=_('Shared secret to sign instance-id request'), secret=True) ] def __init__(self, conf): self.conf = conf self.auth_info = {} def _get_neutron_client(self): qclient = client.Client( username=self.conf.admin_user, password=self.conf.admin_password, tenant_name=self.conf.admin_tenant_name, auth_url=self.conf.auth_url, auth_strategy=self.conf.auth_strategy, region_name=self.conf.auth_region, token=self.auth_info.get('auth_token'), insecure=self.conf.auth_insecure, ca_cert=self.conf.auth_ca_cert, endpoint_url=self.auth_info.get('endpoint_url'), endpoint_type=self.conf.endpoint_type ) return qclient @webob.dec.wsgify(RequestClass=webob.Request) def __call__(self, req): try: LOG.debug(_("Request: %s"), req) instance_id, tenant_id = self._get_instance_and_tenant_id(req) if instance_id: return self._proxy_request(instance_id, tenant_id, req) else: return webob.exc.HTTPNotFound() except Exception: LOG.exception(_("Unexpected error.")) msg = _('An unknown error has occurred. ' 'Please try your request again.') return webob.exc.HTTPInternalServerError(explanation=unicode(msg)) def _get_instance_and_tenant_id(self, req): qclient = self._get_neutron_client() remote_address = req.headers.get('X-Forwarded-For') network_id = req.headers.get('X-Neutron-Network-ID') router_id = req.headers.get('X-Neutron-Router-ID') if network_id: networks = [network_id] else: internal_ports = qclient.list_ports( device_id=router_id, device_owner=DEVICE_OWNER_ROUTER_INTF)['ports'] networks = [p['network_id'] for p in internal_ports] ports = qclient.list_ports( network_id=networks, fixed_ips=['ip_address=%s' % remote_address])['ports'] self.auth_info = qclient.get_auth_info() if len(ports) == 1: return ports[0]['device_id'], ports[0]['tenant_id'] return None, None def _proxy_request(self, instance_id, tenant_id, req): headers = { 'X-Forwarded-For': req.headers.get('X-Forwarded-For'), 'X-Instance-ID': instance_id, 'X-Tenant-ID': tenant_id, 'X-Instance-ID-Signature': self._sign_instance_id(instance_id) } url = urlparse.urlunsplit(( 'http', '%s:%s' % (self.conf.nova_metadata_ip, self.conf.nova_metadata_port), req.path_info, req.query_string, '')) h = httplib2.Http() resp, content = h.request(url, method=req.method, headers=headers, body=req.body) if resp.status == 200: LOG.debug(str(resp)) return content elif resp.status == 403: msg = _( 'The remote metadata server responded with Forbidden. This ' 'response usually occurs when shared secrets do not match.' ) LOG.warn(msg) return webob.exc.HTTPForbidden() elif resp.status == 404: return webob.exc.HTTPNotFound() elif resp.status == 409: return webob.exc.HTTPConflict() elif resp.status == 500: msg = _( 'Remote metadata server experienced an internal server error.' ) LOG.warn(msg) return webob.exc.HTTPInternalServerError(explanation=unicode(msg)) else: raise Exception(_('Unexpected response code: %s') % resp.status) def _sign_instance_id(self, instance_id): return hmac.new(self.conf.metadata_proxy_shared_secret, instance_id, hashlib.sha256).hexdigest()
import time import weakref from eventlet import semaphore from oslo.config import cfg from cinder.openstack.common import fileutils from cinder.openstack.common.gettextutils import _ from cinder.openstack.common import local from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) util_opts = [ cfg.BoolOpt('disable_process_locking', default=False, help='Whether to disable inter-process locks'), cfg.StrOpt('lock_path', help=('Directory to use for lock files. Default to a ' 'temp directory')) ] CONF = cfg.CONF CONF.register_opts(util_opts) def set_defaults(lock_path): cfg.set_defaults(util_opts, lock_path=lock_path) class _InterProcessLock(object):
from nova.i18n import _LE from nova.network import linux_net from nova.network import model as network_model from nova.openstack.common import log as logging from nova.openstack.common import processutils from nova import utils from nova.virt.libvirt import config as vconfig from nova.virt.libvirt import designer from nova.pci import pci_utils from nova.pci import pci_devspec LOG = logging.getLogger(__name__) libvirt_vif_opts = [ cfg.BoolOpt('use_virtio_for_bridges', default=True, help='Use virtio for bridge interfaces with KVM/QEMU'), ] CONF = cfg.CONF CONF.register_opts(libvirt_vif_opts, 'libvirt') CONF.import_opt('use_ipv6', 'nova.netconf') DEV_PREFIX_ETH = 'eth' EBR_INT = 'ebr-int' def is_vif_model_valid_for_virt(virt_type, vif_model): valid_models = { 'qemu': [network_model.VIF_MODEL_VIRTIO, network_model.VIF_MODEL_NE2K_PCI, network_model.VIF_MODEL_PCNET,
from oslo.config import cfg import pecan import six import wsme from solum.common import safe_utils from solum.openstack.common import excutils from solum.openstack.common.gettextutils import _ from solum.openstack.common import log as logging LOG = logging.getLogger(__name__) exc_log_opts = [ cfg.BoolOpt('fatal_exception_format_errors', default=False, help='make exception message format errors fatal') ] CONF = cfg.CONF CONF.register_opts(exc_log_opts) def wrap_exception(notifier=None, publisher_id=None, event_type=None, level=None): """This decorator wraps a method to catch any exceptions. It logs the exception as well as optionally sending it to the notification system. """ def inner(f):
cfg.StrOpt('attestation_server', help='Attestation server HTTP'), cfg.StrOpt('attestation_server_ca_file', help='Attestation server Cert file for Identity verification'), cfg.StrOpt('attestation_port', default='8443', help='Attestation server port'), cfg.StrOpt('attestation_api_url', default='/OpenAttestationWebServices/V1.0', help='Attestation web API URL'), cfg.StrOpt('attestation_auth_blob', help='Attestation authorization blob - must change'), cfg.IntOpt('attestation_auth_timeout', default=60, help='Attestation status cache valid period length'), cfg.BoolOpt('attestation_insecure_ssl', default=False, help='Disable SSL cert verification for Attestation service') ] CONF = cfg.CONF trust_group = cfg.OptGroup(name='trusted_computing', title='Trust parameters') CONF.register_group(trust_group) CONF.register_opts(trusted_opts, group=trust_group) class AttestationService(object): # Provide access wrapper to attestation server to get integrity report. def __init__(self): self.api_url = CONF.trusted_computing.attestation_api_url self.host = CONF.trusted_computing.attestation_server
from paste import deploy from glance.version import version_info as version paste_deploy_opts = [ cfg.StrOpt('flavor', help=_('Partial name of a pipeline in your paste configuration ' 'file with the service name removed. For example, if ' 'your paste section name is ' '[pipeline:glance-api-keystone] use the value ' '"keystone"')), cfg.StrOpt('config_file', help=_('Name of the paste configuration file.')), ] common_opts = [ cfg.BoolOpt('allow_additional_image_properties', default=True, help=_('Whether to allow users to specify image properties ' 'beyond what the image schema provides')), cfg.IntOpt('image_member_quota', default=128, help=_('Maximum number of image members per image. ' 'Negative values evaluate to unlimited.')), cfg.IntOpt('image_property_quota', default=128, help=_('Maximum number of properties allowed on an image. ' 'Negative values evaluate to unlimited.')), cfg.IntOpt('image_tag_quota', default=128, help=_('Maximum number of tags allowed on an image. ' 'Negative values evaluate to unlimited.')), cfg.StrOpt('data_api', default='glance.db.sqlalchemy.api',
from oslo.config import cfg from sahara import exceptions as ex from sahara.i18n import _ from sahara.openstack.common import log from sahara import version cli_opts = [ cfg.StrOpt('host', default='', help='Hostname or IP address that will be used to listen on.'), cfg.IntOpt('port', default=8386, help='Port that will be used to listen on.'), cfg.BoolOpt('log-exchange', default=False, help='Log request/response exchange details: environ, ' 'headers and bodies.') ] edp_opts = [ cfg.IntOpt('job_binary_max_KB', default=5120, help='Maximum length of job binary data in kilobytes that ' 'may be stored or retrieved in a single operation.') ] networking_opts = [ cfg.BoolOpt('use_floating_ips', default=True, help='If set to True, Sahara will use floating IPs to ' 'communicate with instances. To make sure that all '
from cinder.openstack.common import processutils as putils from cinder.openstack.common import units from cinder import utils from cinder.volume.drivers import remotefs VERSION = '1.1.0' LOG = logging.getLogger(__name__) volume_opts = [ cfg.StrOpt('nfs_shares_config', default='/etc/cinder/nfs_shares', help='File with the list of available nfs shares'), cfg.BoolOpt('nfs_sparsed_volumes', default=True, help=('Create volumes as sparsed files which take no space.' 'If set to False volume is created as regular file.' 'In such case volume creation takes a lot of time.')), cfg.FloatOpt('nfs_used_ratio', default=0.95, help=('Percent of ACTUAL usage of the underlying volume ' 'before no new volumes can be allocated to the volume ' 'destination.')), cfg.FloatOpt('nfs_oversub_ratio', default=1.0, help=('This will compare the allocated to available space on ' 'the volume destination. If the ratio exceeds this ' 'number, the destination will no longer be valid.')), cfg.StrOpt('nfs_mount_point_base', default='$state_path/mnt', help=('Base dir containing mount points for nfs shares.')),
def _get_my_ip(): """Returns the actual ip of the local machine. This code figures out what source address would be used if some traffic were to be sent out to some well known address on the Internet. In this case, a Google DNS server is used, but the specific address does not matter much. No traffic is actually sent. """ try: csock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) csock.connect(('8.8.8.8', 80)) (addr, port) = csock.getsockname() csock.close() return addr except socket.error: return "127.0.0.1" netconf_opts = [ cfg.StrOpt('my_ip', default=_get_my_ip(), help='IP address of this host.'), cfg.BoolOpt('use_ipv6', default=False, help='Use IPv6.'), ] CONF.register_opts(netconf_opts)
from oslo.config import cfg from oslo_concurrency import processutils from nova.compute import arch from nova.i18n import _ from nova.i18n import _LI from nova.i18n import _LW from nova.openstack.common import log as logging from nova import utils from nova.virt import images from nova.virt.libvirt import config as vconfig from nova.virt import volumeutils libvirt_opts = [ cfg.BoolOpt('snapshot_compression', default=False, help='Compress snapshot images when possible. This ' 'currently applies exclusively to qcow2 images'), ] CONF = cfg.CONF CONF.register_opts(libvirt_opts, 'libvirt') CONF.import_opt('instances_path', 'nova.compute.manager') LOG = logging.getLogger(__name__) def execute(*args, **kwargs): return utils.execute(*args, **kwargs) def get_iscsi_initiator(): return volumeutils.get_iscsi_initiator()
help=_("The policy file to use")), cfg.StrOpt('auth_strategy', default='keystone', help=_("The type of authentication to use")), cfg.StrOpt('core_plugin', help=_("The core plugin Neutron will use")), cfg.ListOpt('service_plugins', default=[], help=_("The service plugins Neutron will use")), cfg.StrOpt('base_mac', default="fa:16:3e:00:00:00", help=_("The base MAC address Neutron will use for VIFs")), cfg.IntOpt('mac_generation_retries', default=16, help=_("How many times Neutron will retry MAC generation")), cfg.BoolOpt('allow_bulk', default=True, help=_("Allow the usage of the bulk API")), cfg.BoolOpt('allow_pagination', default=False, help=_("Allow the usage of the pagination")), cfg.BoolOpt('allow_sorting', default=False, help=_("Allow the usage of the sorting")), cfg.StrOpt('pagination_max_limit', default="-1", help=_("The maximum number of items returned in a single " "response, value was 'infinite' or negative integer " "means no limit")), cfg.IntOpt('max_dns_nameservers', default=5, help=_("Maximum number of DNS nameservers")),
from nova import network from nova.network import linux_net from nova.openstack.common import importutils from nova.openstack.common import lockutils from nova.openstack.common import log as logging from nova.virt import netutils LOG = logging.getLogger(__name__) firewall_opts = [ cfg.StrOpt('firewall_driver', default=None, help='Firewall driver ' '(defaults to hypervisor specific iptables driver)'), cfg.BoolOpt('allow_same_net_traffic', default=True, help='Whether to allow network traffic from same network'), ] CONF = cfg.CONF CONF.register_opts(firewall_opts) CONF.import_opt('use_ipv6', 'nova.netconf') def load_driver(default, *args, **kwargs): fw_class = importutils.import_class(CONF.firewall_driver or default) return fw_class(*args, **kwargs) class FirewallDriver(object): """Firewall Driver base class.
pool of available storage (Default: True) """ from oslo.config import cfg from vsm import exception from vsm import flags from vsm import utils db_opts = [ cfg.StrOpt('db_backend', default='sqlalchemy', help='The backend to use for db'), cfg.BoolOpt('enable_new_services', default=True, help='Services to be added to the available pool on create'), cfg.StrOpt('storage_name_template', default='storage-%s', help='Template string to be used to generate storage names'), cfg.StrOpt('snapshot_name_template', default='snapshot-%s', help='Template string to be used to generate snapshot names'), cfg.StrOpt('backup_name_template', default='backup-%s', help='Template string to be used to generate backup names'), ] FLAGS = flags.FLAGS FLAGS.register_opts(db_opts)
'socket error, etc. ' 'Used only if compute_driver is ' 'vmwareapi.VMwareESXDriver or vmwareapi.VMwareVCDriver.'), cfg.IntOpt('vnc_port', default=5900, deprecated_name='vnc_port', deprecated_group='DEFAULT', help='VNC starting port'), cfg.IntOpt('vnc_port_total', default=10000, deprecated_name='vnc_port_total', deprecated_group='DEFAULT', help='Total number of VNC ports'), cfg.BoolOpt('use_linked_clone', default=True, deprecated_name='use_linked_clone', deprecated_group='DEFAULT', help='Whether to use linked clone'), ] CONF = cfg.CONF CONF.register_opts(vmwareapi_opts, 'vmware') TIME_BETWEEN_API_CALL_RETRIES = 2.0 class Failure(Exception): """Base Exception class for handling task failures.""" def __init__(self, details): self.details = details
import tempfile import threading import time import weakref from oslo.config import cfg from heat.openstack.common import fileutils from heat.openstack.common.gettextutils import _, _LE, _LI from heat.openstack.common import log as logging LOG = logging.getLogger(__name__) util_opts = [ cfg.BoolOpt('disable_process_locking', default=False, help='Enables or disables inter-process locks.'), cfg.StrOpt('lock_path', default=os.environ.get("HEAT_LOCK_PATH"), help='Directory to use for lock files.') ] CONF = cfg.CONF CONF.register_opts(util_opts) def set_defaults(lock_path): cfg.set_defaults(util_opts, lock_path=lock_path) class _FileLock(object):
from sqlalchemy import exc as sqla_exc from sqlalchemy.interfaces import PoolListener import sqlalchemy.orm from sqlalchemy.pool import NullPool, StaticPool from sqlalchemy.sql.expression import literal_column from ceilometer.openstack.common.db import exception from ceilometer.openstack.common.gettextutils import _ from ceilometer.openstack.common import timeutils sqlite_db_opts = [ cfg.StrOpt('sqlite_db', default='ceilometer.sqlite', help='The file name to use with SQLite'), cfg.BoolOpt('sqlite_synchronous', default=True, help='If True, SQLite uses synchronous mode'), ] database_opts = [ cfg.StrOpt( 'connection', default='sqlite:///' + os.path.abspath( os.path.join(os.path.dirname(__file__), '../', '$sqlite_db')), help='The SQLAlchemy connection string used to connect to the ' 'database', secret=True, deprecated_opts=[ cfg.DeprecatedOpt('sql_connection', group='DEFAULT'), cfg.DeprecatedOpt('sql_connection', group='DATABASE'), cfg.DeprecatedOpt('connection', group='sql'),
from quantum.agent.linux import ip_lib from quantum.agent.linux import ovs_lib from quantum.agent.linux import utils from quantum.common import exceptions from quantum.extensions.flavor import (FLAVOR_NETWORK) from quantum.openstack.common import importutils from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) OPTS = [ cfg.StrOpt('ovs_integration_bridge', default='br-int', help=_('Name of Open vSwitch bridge to use')), cfg.BoolOpt('ovs_use_veth', default=False, help=_('Uses veth for an interface or not')), cfg.StrOpt('network_device_mtu', help=_('MTU setting for device.')), cfg.StrOpt('meta_flavor_driver_mappings', help=_('Mapping between flavor and LinuxInterfaceDriver')), cfg.StrOpt('admin_user', help=_("Admin username")), cfg.StrOpt('admin_password', help=_("Admin password"), secret=True), cfg.StrOpt('admin_tenant_name', help=_("Admin tenant name")), cfg.StrOpt('auth_url', help=_("Authentication URL")), cfg.StrOpt('auth_strategy', default='keystone', help=_("The type of authentication to use")), cfg.StrOpt('auth_region', help=_("Authentication region")), ]
import copy import logging import threading from oslo.config import cfg from oslo.db import api from oslo.db.openstack.common.gettextutils import _LE LOG = logging.getLogger(__name__) tpool_opts = [ cfg.BoolOpt('use_tpool', default=False, deprecated_name='dbapi_use_tpool', deprecated_group='DEFAULT', help='Enable the experimental use of thread pooling for ' 'all DB API calls'), ] class TpoolDbapiWrapper(object): """DB API wrapper class. This wraps the oslo DB API with an option to be able to use eventlet's thread pooling. Since the CONF variable may not be loaded at the time this class is instantiated, we must look at it on the first DB API call. """ def __init__(self, conf, backend_mapping): self._db_api = None
_SANITIZE_PATTERNS = [] _FORMAT_PATTERNS = [r'(%(key)s\s*[=]\s*[\"\']).*?([\"\'])', r'(<%(key)s>).*?(</%(key)s>)', r'([\"\']%(key)s[\"\']\s*:\s*[\"\']).*?([\"\'])', r'([\'"].*?%(key)s[\'"]\s*:\s*u?[\'"]).*?([\'"])'] for key in _SANITIZE_KEYS: for pattern in _FORMAT_PATTERNS: reg_ex = re.compile(pattern % {'key': key}, re.DOTALL) _SANITIZE_PATTERNS.append(reg_ex) common_cli_opts = [ cfg.BoolOpt('debug', short='d', default=False, help='Print debugging output (set logging level to ' 'DEBUG instead of default WARNING level).'), cfg.BoolOpt('verbose', short='v', default=False, help='Print more verbose output (set logging level to ' 'INFO instead of default WARNING level).'), ] logging_cli_opts = [ cfg.StrOpt('log-config-append', metavar='PATH', deprecated_name='log-config', help='The name of logging configuration file. It does not ' 'disable existing loggers, but just appends specified '
'glance.store.swift.Store', ], help=_('List of which store classes and store class locations ' 'are currently known to glance at startup.')), cfg.StrOpt('default_store', default='file', help=_("Default scheme to use to store image data. The " "scheme must be registered by one of the stores " "defined by the 'known_stores' config option.")), cfg.StrOpt('scrubber_datadir', default='/var/lib/glance/scrubber', help=_('Directory that the scrubber will use to track ' 'information about what to delete. Make sure this is ' 'also set in glance-api.conf')), cfg.BoolOpt('delayed_delete', default=False, help=_('Turn on/off delayed delete.')), cfg.IntOpt('scrub_time', default=0, help=_('The amount of time in seconds to delay before ' 'performing a delete.')), ] CONF = cfg.CONF CONF.register_opts(store_opts) class BackendException(Exception): pass
# under the License. # # @author: Sumit Naiksatam, [email protected], Big Switch Networks, Inc. # @author: Sridar Kandaswamy, [email protected], Cisco Systems, Inc. # @author: Dan Florea, [email protected], Cisco Systems, Inc. from oslo.config import cfg from neutron.common import rpc as n_rpc from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) FWaaSOpts = [ cfg.StrOpt('driver', default='', help=_("Name of the FWaaS Driver")), cfg.BoolOpt('enabled', default=False, help=_("Enable FWaaS")), ] cfg.CONF.register_opts(FWaaSOpts, 'fwaas') class FWaaSPluginApiMixin(n_rpc.RpcProxy): """Agent side of the FWaaS agent to FWaaS Plugin RPC API.""" RPC_API_VERSION = '1.0' def __init__(self, topic, host): super(FWaaSPluginApiMixin, self).__init__(topic=topic, default_version=self.RPC_API_VERSION) self.host = host def set_firewall_status(self, context, firewall_id, status):
# under the License. import base64 from oslo.config import cfg from cloudbaseinit.openstack.common import log as logging from cloudbaseinit.osutils import factory as osutils_factory from cloudbaseinit.plugins.common import base from cloudbaseinit.plugins.common import constants from cloudbaseinit.utils import crypt opts = [ 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'), ] CONF = cfg.CONF CONF.register_opts(opts) CONF.import_opt('username', 'cloudbaseinit.plugins.common.createuser') LOG = logging.getLogger(__name__) class SetUserPasswordPlugin(base.BasePlugin): def _encrypt_password(self, ssh_pub_key, password): cm = crypt.CryptManager() with cm.load_ssh_rsa_public_key(ssh_pub_key) as rsa:
from nova.openstack.common import jsonutils from nova.openstack.common import log as logging from nova import utils from nova.virt.libvirt import utils as virtutils LOG = logging.getLogger(__name__) imagecache_opts = [ cfg.StrOpt('image_info_filename_pattern', default='$instances_path/$image_cache_subdirectory_name/' '%(image)s.info', help='Allows image information files to be stored in ' 'non-standard locations', deprecated_group='DEFAULT'), cfg.BoolOpt('remove_unused_base_images', default=True, help='Should unused base images be removed?', deprecated_group='DEFAULT'), cfg.BoolOpt('remove_unused_kernels', default=False, help='Should unused kernel images be removed? This is only ' 'safe to enable if all compute nodes have been updated ' 'to support this option. This will be enabled by default ' 'in future.', deprecated_group='DEFAULT'), cfg.IntOpt('remove_unused_resized_minimum_age_seconds', default=3600, help='Unused resized base images younger than this will not be ' 'removed', deprecated_group='DEFAULT'), cfg.IntOpt('remove_unused_original_minimum_age_seconds', default=(24 * 3600),
from neutron.agent.common import config from neutron.plugins.common import constants as p_const from neutron.plugins.openvswitch.common import constants DEFAULT_BRIDGE_MAPPINGS = [] DEFAULT_VLAN_RANGES = [] DEFAULT_TUNNEL_RANGES = [] DEFAULT_TUNNEL_TYPES = [] ovs_opts = [ cfg.StrOpt('integration_bridge', default='br-int', help=_("Integration bridge to use.")), cfg.BoolOpt('enable_tunneling', default=False, help=_("Enable tunneling support.")), cfg.StrOpt('tunnel_bridge', default='br-tun', help=_("Tunnel bridge to use.")), cfg.StrOpt('int_peer_patch_port', default='patch-tun', help=_("Peer patch port in integration bridge for tunnel " "bridge.")), cfg.StrOpt('tun_peer_patch_port', default='patch-int', help=_("Peer patch port in tunnel bridge for integration " "bridge.")), cfg.StrOpt('local_ip', default='', help=_("Local IP address of GRE tunnel endpoints.")),
import uuid from oslo.config import cfg from cinder import context from cinder import exception from cinder.openstack.common import log as logging from cinder.volume.drivers.san.san import SanISCSIDriver from cinder.volume import volume_types VERSION = 1.2 LOG = logging.getLogger(__name__) sf_opts = [ cfg.BoolOpt('sf_emulate_512', default=True, help='Set 512 byte emulation on volume creation; '), cfg.BoolOpt('sf_allow_tenant_qos', default=False, help='Allow tenants to specify QOS on create'), ] class SolidFire(SanISCSIDriver): """OpenStack driver to enable SolidFire cluster. Version history: 1.0 - Initial driver 1.1 - Refactor, clone support, qos by type and minor bug fixes """