""" from oslo.config import cfg from cinder import exception from cinder.openstack.common import log as logging from cinder.volume.drivers.huawei import huawei_dorado from cinder.volume.drivers.huawei import huawei_hvs from cinder.volume.drivers.huawei import huawei_t from cinder.volume.drivers.huawei import huawei_utils LOG = logging.getLogger(__name__) huawei_opt = [ cfg.StrOpt('cinder_huawei_conf_file', default='/etc/cinder/cinder_huawei_conf.xml', help='The configuration file for the Cinder Huawei ' 'driver') ] CONF = cfg.CONF CONF.register_opts(huawei_opt) class HuaweiVolumeDriver(object): """Define an unified driver for Huawei drivers.""" def __init__(self, *args, **kwargs): super(HuaweiVolumeDriver, self).__init__() self._product = { 'T': huawei_t, 'Dorado': huawei_dorado, 'HVS': huawei_hvs
import urllib2 import urlparse from oslo.config import cfg from cinder import exception from cinder.image import image_utils from cinder.openstack.common import log as logging from cinder import units from cinder.volume import driver LOG = logging.getLogger(__name__) volume_opts = [ cfg.StrOpt('scality_sofs_config', default=None, help='Path or URL to Scality SOFS configuration file'), cfg.StrOpt('scality_sofs_mount_point', default='$state_path/scality', help='Base dir where Scality SOFS shall be mounted'), cfg.StrOpt('scality_sofs_volume_dir', default='cinder/volumes', help='Path from Scality SOFS root to volume dir'), ] CONF = cfg.CONF CONF.register_opts(volume_opts) class ScalityDriver(driver.VolumeDriver): """Scality SOFS cinder driver.
# under the License. import errno import os from oslo.config import cfg from cinder import exception from cinder.openstack.common import log as logging from cinder.volume.drivers import nfs LOG = logging.getLogger(__name__) volume_opts = [ cfg.StrOpt('glusterfs_shares_config', default='/etc/cinder/glusterfs_shares', help='File with the list of available gluster shares'), cfg.StrOpt('glusterfs_mount_point_base', default='$state_path/mnt', help='Base dir containing mount points for gluster shares'), cfg.StrOpt('glusterfs_disk_util', default='df', help='Use du or df for free space calculation'), cfg.BoolOpt('glusterfs_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.')) ] CONF = cfg.CONF
import functools import novaclient from novaclient.v1_1 import client as nova_client from oslo.config import cfg from ceilometer.openstack.common import log nova_opts = [ cfg.BoolOpt('nova_http_log_debug', default=False, help='Allow novaclient\'s debug log output.'), ] service_types_opts = [ cfg.StrOpt('nova', default='compute', help='Nova service type.'), ] cfg.CONF.register_opts(nova_opts) cfg.CONF.register_opts(service_types_opts, group='service_types') cfg.CONF.import_opt('http_timeout', 'ceilometer.service') cfg.CONF.import_group('service_credentials', 'ceilometer.service') LOG = log.getLogger(__name__) def logged(func): @functools.wraps(func) def with_logging(*args, **kwargs): try:
import six from neutron.agent.common import config from neutron.agent.linux import ip_lib from neutron.agent.linux import ovs_lib from neutron.agent.linux import utils from neutron.common import exceptions from neutron.extensions import flavor from neutron.openstack.common import importutils from neutron.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.IntOpt('network_device_mtu', help=_('MTU setting for device.')), cfg.StrOpt('meta_flavor_driver_mappings', help=_('Mapping between flavor and LinuxInterfaceDriver. ' 'It is specific to MetaInterfaceDriver used with ' 'admin_user, admin_password, admin_tenant_name, ' 'admin_url, auth_strategy, auth_region and ' 'endpoint_type.')), 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")),
from cinder import exception from cinder.image import image_utils from cinder.openstack.common import excutils from cinder.openstack.common import log as logging from cinder.openstack.common import processutils from cinder.openstack.common import units from cinder.volume.drivers.hds.hnas_backend import HnasBackend from cinder.volume.drivers import nfs HDS_HNAS_NFS_VERSION = '1.0.0' LOG = logging.getLogger(__name__) NFS_OPTS = [ cfg.StrOpt('hds_hnas_nfs_config_file', default='/opt/hds/hnas/cinder_nfs_conf.xml', help='configuration file for HDS NFS cinder plugin'), ] CONF = cfg.CONF CONF.register_opts(NFS_OPTS) HNAS_DEFAULT_CONFIG = {'hnas_cmd': 'ssc'} def _xml_read(root, element, check=None): """Read an xml element. :param root: XML object :param element: string desired tag :param check: string if present, throw exception if element missing
# 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. """Base class for classes that need modular database access.""" from oslo.config import cfg from nova.openstack.common import importutils db_driver_opt = cfg.StrOpt('db_driver', default='nova.db', help='The driver to use for database access') CONF = cfg.CONF CONF.register_opt(db_driver_opt) class Base(object): """DB driver is injected in the init method.""" def __init__(self, db_driver=None): if not db_driver: db_driver = CONF.db_driver self.db = importutils.import_module(db_driver) # pylint: disable=C0103
from oslo.config import cfg from cinder import context from cinder import exception from cinder import manager from cinder.openstack.common import excutils from cinder.openstack.common import importutils from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) backup_manager_opts = [ cfg.StrOpt('backup_driver', default='cinder.backup.drivers.swift', help='Driver to use for backups.', deprecated_name='backup_service'), ] # This map doesn't need to be extended in the future since it's only # for old backup services mapper = {'cinder.backup.services.swift': 'cinder.backup.drivers.swift', 'cinder.backup.services.ceph': 'cinder.backup.drivers.ceph'} CONF = cfg.CONF CONF.register_opts(backup_manager_opts) class BackupManager(manager.SchedulerDependentManager): """Manages backup of block storage devices."""
from oslo.config import cfg from savanna import conductor as c from savanna import context from savanna.openstack.common import uuidutils from savanna.plugins.general import utils as u from savanna.service.edp import hdfs_helper as h from savanna.service.edp import oozie as o from savanna.service.edp.workflow_creator import mapreduce_workflow as mr_flow from savanna.service.edp.workflow_creator import pig_workflow as pig_flow from savanna.utils import remote from savanna.utils import xmlutils as x opts = [ cfg.StrOpt('job_workflow_postfix', default='', help='Postfix for storing jobs in hdfs. Will be ' 'added to /user/hadoop/') ] CONF = cfg.CONF CONF.register_opts(opts) conductor = c.API main_res_names = {'Pig': 'script.pig', 'Jar': 'main.jar'} def run_job(ctx, job_execution): cluster = conductor.cluster_get(ctx, job_execution.cluster_id) if cluster.status != 'Active': return job_execution.status
from nova.openstack.common import lockutils from nova.openstack.common import log as logging from nova import paths from nova.storage import linuxscsi from nova import utils from nova.virt.libvirt import config as vconfig from nova.virt.libvirt import utils as virtutils LOG = logging.getLogger(__name__) volume_opts = [ cfg.IntOpt('num_iscsi_scan_tries', default=3, help='number of times to rescan iSCSI target to find volume'), cfg.StrOpt('rbd_user', default=None, help='the RADOS client name for accessing rbd volumes'), cfg.StrOpt('rbd_secret_uuid', default=None, help='the libvirt uuid of the secret for the rbd_user' 'volumes'), cfg.StrOpt('nfs_mount_point_base', default=paths.state_path_def('mnt'), help='Dir where the nfs volume is mounted on the compute node'), cfg.StrOpt('nfs_mount_options', default=None, help='Mount options passed to the nfs client. See section ' 'of the nfs man page for details'), cfg.IntOpt('num_aoe_discover_tries', default=3, help='number of times to rediscover AoE target to find volume'),
CACHE_EXPIRATION = 15 # in seconds CONF = cfg.CONF CONF.import_opt('use_forwarded_for', 'nova.api.auth') metadata_proxy_opts = [ cfg.BoolOpt( 'service_metadata_proxy', default=False, help='Set flag to indicate Neutron will proxy metadata requests and ' 'resolve instance ids.', deprecated_group='DEFAULT', deprecated_name='service_neutron_metadata_proxy'), cfg.StrOpt( 'metadata_proxy_shared_secret', default='', secret=True, help='Shared secret to validate proxies Neutron metadata requests', deprecated_group='DEFAULT', deprecated_name='neutron_metadata_proxy_shared_secret') ] # metadata_proxy_opts options in the DEFAULT group were deprecated in Juno CONF.register_opts(metadata_proxy_opts, 'neutron') LOG = logging.getLogger(__name__) class MetadataRequestHandler(wsgi.Application): """Serve metadata.""" def __init__(self): self._cache = memorycache.get_client()
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ Client side of the scheduler manager RPC API. """ from oslo.config import cfg from nova.objects import base as objects_base from nova.openstack.common import jsonutils from nova import rpcclient rpcapi_opts = [ cfg.StrOpt('scheduler_topic', default='scheduler', help='the topic scheduler nodes listen on'), ] CONF = cfg.CONF CONF.register_opts(rpcapi_opts) rpcapi_cap_opt = cfg.StrOpt( 'scheduler', help='Set a version cap for messages sent to scheduler services') CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') class SchedulerAPI(rpcclient.RpcProxy): '''Client side of the scheduler rpc API.
_ENGINE = None _MAKER = None _MAX_RETRIES = None _RETRY_INTERVAL = None BASE = models.BASE sa_logger = None LOG = os_logging.getLogger(__name__) STATUSES = [ 'active', 'saving', 'queued', 'killed', 'pending_delete', 'deleted' ] sql_connection_opt = cfg.StrOpt('sql_connection', default='sqlite:///glance.sqlite', secret=True, metavar='CONNECTION', help=_('A valid SQLAlchemy connection ' 'string for the registry database. ' 'Default: %(default)s')) db_opts = [ cfg.IntOpt('sql_idle_timeout', default=3600, help=_('Period in seconds after which SQLAlchemy should ' 'reestablish its connection to the database.')), cfg.IntOpt('sql_max_retries', default=60, help=_('The number of times to retry a connection to the SQL' 'server.')), cfg.IntOpt('sql_retry_interval', default=1,
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 ' 'files. For details about logging configuration files, ' 'see the Python logging module documentation.'), cfg.StrOpt('log-format', metavar='FORMAT', help='DEPRECATED. ' 'A logging.Formatter log message format string which may ' 'use any of the available logging.LogRecord attributes. ' 'This option is deprecated. Please use ' 'logging_context_format_string and ' 'logging_default_format_string instead.'), cfg.StrOpt('log-date-format', default=_DEFAULT_LOG_DATE_FORMAT, metavar='DATE_FORMAT', help='Format string for %%(asctime)s in log records. '
import webob from webob import exc from rack.api import wsgi from rack.api import xmlutil from rack import exception from rack.openstack.common.gettextutils import _ from rack.openstack.common import log as logging osapi_opts = [ cfg.IntOpt('osapi_max_limit', default=1000, help='The maximum number of items returned in a single ' 'response from a collection resource'), cfg.StrOpt('osapi_compute_link_prefix', help='Base URL that will be presented to users in links ' 'to the OpenStack Compute API'), cfg.StrOpt('osapi_glance_link_prefix', help='Base URL that will be presented to users in links ' 'to glance resources'), ] CONF = cfg.CONF CONF.register_opts(osapi_opts) LOG = logging.getLogger(__name__) VALID_NAME_REGEX = re.compile("^(?! )[\w. _-]+(?<! )$", re.UNICODE) XML_NS_V11 = 'http://docs.openstack.org/compute/api/v1.1'
from oslo.config import cfg import webob.exc import glance.api.policy from glance.common import exception from glance.openstack.common import log as logging from glance.openstack.common import policy # NOTE(bourke): The default dict_type is collections.OrderedDict in py27, but # we must set manually for compatibility with py26 CONFIG = ConfigParser.SafeConfigParser(dict_type=OrderedDict) LOG = logging.getLogger(__name__) property_opts = [ cfg.StrOpt('property_protection_file', default=None, help=_('The location of the property protection file.')), cfg.StrOpt('property_protection_rule_format', default='roles', help=_('This config value indicates whether "roles" or ' '"policies" are used in the property protection file.')), ] CONF = cfg.CONF CONF.register_opts(property_opts) def is_property_protection_enabled(): if CONF.property_protection_file: return True return False
import nova.context from nova import exception from nova import manager from nova.openstack.common import excutils from nova.openstack.common import importutils from nova.openstack.common import jsonutils from nova.openstack.common import log as logging from nova.openstack.common import periodic_task from nova.openstack.common.rpc import common as rpc_common from nova import quota from nova.scheduler import utils as scheduler_utils LOG = logging.getLogger(__name__) scheduler_driver_opt = cfg.StrOpt( 'scheduler_driver', default='nova.scheduler.filter_scheduler.FilterScheduler', help='Default driver to use for the scheduler') CONF = cfg.CONF CONF.register_opt(scheduler_driver_opt) QUOTAS = quota.QUOTAS class SchedulerManager(manager.Manager): """Chooses a host to run instances on.""" RPC_API_VERSION = '2.7' def __init__(self, scheduler_driver=None, *args, **kwargs): if not scheduler_driver:
from nova import objects from nova.objects import base as objects_base from nova.openstack.common.fixture import logging as log_fixture from nova.openstack.common.fixture import moxstubout from nova.openstack.common import log as nova_logging from nova.openstack.common import timeutils from nova import paths from nova import rpc from nova import service from nova.tests import conf_fixture from nova.tests import policy_fixture from nova import utils test_opts = [ cfg.StrOpt('sqlite_clean_db', default='clean.sqlite', help='File name of clean sqlite db'), ] CONF = cfg.CONF CONF.register_opts(test_opts) CONF.import_opt('connection', 'nova.openstack.common.db.options', group='database') CONF.import_opt('sqlite_db', 'nova.openstack.common.db.options', group='database') CONF.import_opt('enabled', 'nova.api.openstack', group='osapi_v3') CONF.set_override('use_stderr', False) nova_logging.setup('nova')
from oslo.serialization import jsonutils #from nova.openstack.common import log as logging from oslo_log import log as logging #from nova.openstack.common import timeutils from oslo_utils import timeutils from nova.scheduler import filters from lxml import etree import base64 from base64 import b64encode import random LOG = logging.getLogger(__name__) trusted_opts = [ 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='/mtwilson/v2/host-attestations', help='attestation web API URL'), cfg.StrOpt('attestation_host_url', default='/mtwilson/v2/hosts', help='attestation web API URL'), cfg.StrOpt('attestation_auth_blob', help='attestation authorization blob - must change'), cfg.IntOpt('attestation_auth_timeout', default=60,
""" from oslo.config import cfg from oslo.utils import importutils from cinder import exception from cinder.i18n import _, _LI from cinder.openstack.common import log as logging from cinder.volume import configuration as config from cinder.zonemanager import fc_common LOG = logging.getLogger(__name__) zone_manager_opts = [ cfg.StrOpt('zone_driver', default='cinder.zonemanager.drivers.brocade.brcd_fc_zone_driver' '.BrcdFCZoneDriver', help='FC Zone Driver responsible for zone management'), cfg.StrOpt('zoning_policy', default='initiator-target', help='Zoning policy configured by user'), cfg.StrOpt('fc_fabric_names', default=None, help='Comma separated list of fibre channel fabric names.' ' This list of names is used to retrieve other SAN credentials' ' for connecting to each SAN fabric'), cfg.StrOpt('fc_san_lookup_service', default='cinder.zonemanager.drivers.brocade' '.brcd_fc_san_lookup_service.BrcdFCSanLookupService', help='FC San Lookup Service'), ]
from sahara.i18n import _LI from sahara.i18n import _LW from sahara.openstack.common import log from sahara.plugins import base as plugins_base from sahara.service import api as service_api from sahara.service.edp import api as edp_api from sahara.service import ops as service_ops from sahara.service import periodic from sahara.utils import api as api_utils from sahara.utils import remote from sahara.utils import rpc as messaging LOG = log.getLogger(__name__) opts = [ cfg.StrOpt('os_region_name', help='Region name used to get services endpoints.'), cfg.StrOpt('infrastructure_engine', default='direct', help='An engine which will be used to provision ' 'infrastructure for Hadoop cluster.'), cfg.StrOpt('remote', default='ssh', help='A method for Sahara to execute commands ' 'on VMs.') ] CONF = cfg.CONF CONF.register_opts(opts) def setup_common(possible_topdir, service_name):
from sds.openstack.common import log as logging LOG = logging.getLogger(__name__) ssh_opts = [ cfg.BoolOpt('strict_ssh_host_key_policy', default=False, help='Option to enable strict host key checking. When ' 'set to "True" Sds will only connect to systems ' 'with a host key present in the configured ' '"ssh_hosts_key_file". When set to "False" the host key ' 'will be saved upon first connection and used for ' 'subsequent connections. Default=False'), cfg.StrOpt('ssh_hosts_key_file', default='$state_path/ssh_known_hosts', help='File containing SSH host keys for the systems with which ' 'Sds needs to communicate. OPTIONAL: ' 'Default=$state_path/known_hosts'), ] CONF = cfg.CONF CONF.register_opts(ssh_opts) class SSHPool(pools.Pool): """A simple eventlet pool to hold ssh connections.""" def __init__(self, ip, port, conn_timeout, login,
"""Handler for producing network counter messages from Neutron notification events. """ from oslo.config import cfg import oslo.messaging from ceilometer.openstack.common.gettextutils import _ from ceilometer.openstack.common import log from ceilometer import plugin from ceilometer import sample OPTS = [ cfg.StrOpt('neutron_control_exchange', default='neutron', help="Exchange name for Neutron notifications.", deprecated_name='quantum_control_exchange'), ] cfg.CONF.register_opts(OPTS) LOG = log.getLogger(__name__) class NetworkNotificationBase(plugin.NotificationBase): resource_name = None @property def event_types(self): return [
# 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. import os import ssl from oslo.config import cfg from keystone.openstack.common.gettextutils import _ # noqa ssl_opts = [ cfg.StrOpt('ca_file', default=None, help="CA certificate file to use to verify " "connecting clients"), cfg.StrOpt('cert_file', default=None, help="Certificate file to use when starting " "the server securely"), cfg.StrOpt('key_file', default=None, help="Private key file to use when starting " "the server securely"), ] CONF = cfg.CONF CONF.register_opts(ssl_opts, "ssl")
# 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. """ Client side of the console RPC API. """ from oslo.config import cfg from oslo import messaging from nova import rpc rpcapi_opts = [ cfg.StrOpt('console_topic', default='console', help='The topic console proxy nodes listen on'), ] CONF = cfg.CONF CONF.register_opts(rpcapi_opts) rpcapi_cap_opt = cfg.StrOpt( 'console', help='Set a version cap for messages sent to console services') CONF.register_opt(rpcapi_cap_opt, 'upgrade_levels') class ConsoleAPI(object): '''Client side of the console rpc API. API version history:
from oslo.config import cfg import six 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 neutron.openstack.common.db import exception from neutron.openstack.common.gettextutils import _ from neutron.openstack.common import timeutils sqlite_db_opts = [ cfg.StrOpt('sqlite_db', default='neutron.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=[
# [monitor_authtoken] # auth_host = 127.0.0.1 # auth_port = 35357 # auth_protocol = http # admin_tenant_name = admin # admin_user = admin # admin_password = badpassword # when deploy Keystone auth_token middleware with Swift, user may elect # to use Swift memcache instead of the local Keystone memcache. Swift memcache # is passed in from the request environment and its identified by the # 'swift.cache' key. However it could be different, depending on deployment. # To use Swift memcache, you must set the 'cache' option to the environment # key where the Swift cache object is stored. opts = [ cfg.StrOpt('auth_admin_prefix', default=''), cfg.StrOpt('auth_host', default='127.0.0.1'), cfg.IntOpt('auth_port', default=35357), cfg.StrOpt('auth_protocol', default='https'), cfg.StrOpt('auth_uri', default=None), cfg.StrOpt('auth_version', default=None), cfg.BoolOpt('delay_auth_decision', default=False), cfg.BoolOpt('http_connect_timeout', default=None), cfg.StrOpt('http_handler', default=None), cfg.StrOpt('admin_token', secret=True), cfg.StrOpt('admin_user'), cfg.StrOpt('admin_password', secret=True), cfg.StrOpt('admin_tenant_name', default='admin'), cfg.StrOpt('cache', default=None), # env key for the swift cache cfg.StrOpt('certfile'), cfg.StrOpt('keyfile'),
# 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. """VIF drivers for XenAPI.""" from oslo.config import cfg from nova.virt.xenapi import network_utils from nova.virt.xenapi import vm_utils xenapi_ovs_integration_bridge_opt = cfg.StrOpt( 'xenapi_ovs_integration_bridge', default='xapi1', help='Name of Integration Bridge used by Open vSwitch') CONF = cfg.CONF CONF.register_opt(xenapi_ovs_integration_bridge_opt) class XenVIFDriver(object): def __init__(self, xenapi_session): self._session = xenapi_session class XenAPIBridgeDriver(XenVIFDriver): """VIF Driver for XenAPI that uses XenAPI to create Networks.""" def plug(self, instance, vif, vm_ref=None, device=None): if not vm_ref:
cfg.BoolOpt('monkey_patch', default=False, help='Whether to log monkey patching'), cfg.ListOpt('monkey_patch_modules', default=[ 'nova.api.ec2.cloud:%s' % (notify_decorator), 'nova.compute.api:%s' % (notify_decorator) ], help='List of modules/decorators to monkey patch'), ] utils_opts = [ cfg.IntOpt('password_length', default=12, help='Length of generated instance admin passwords'), cfg.StrOpt('instance_usage_audit_period', default='month', help='time period to generate instance usages for. ' 'Time period must be hour, day, month or year'), cfg.StrOpt('rootwrap_config', default="/etc/nova/rootwrap.conf", help='Path to the rootwrap configuration file to use for ' 'running commands as root'), cfg.StrOpt('tempdir', default=None, help='Explicitly specify the temporary working directory'), ] CONF = cfg.CONF CONF.register_opts(monkey_patch_opts) CONF.register_opts(utils_opts) LOG = logging.getLogger(__name__)
from nova.compute import flavors from nova import conductor from nova import context from nova.db import base from nova import exception from nova.network import api as network_api from nova.network import model as network_model from nova.network import quantumv2 from nova.network.security_group import openstack_driver from nova.openstack.common import excutils from nova.openstack.common import log as logging from nova.openstack.common import uuidutils quantum_opts = [ cfg.StrOpt('quantum_url', default='http://127.0.0.1:9696', help='URL for connecting to quantum'), cfg.IntOpt('quantum_url_timeout', default=30, help='timeout value for connecting to quantum in seconds'), cfg.StrOpt('quantum_admin_username', help='username for connecting to quantum in admin context'), cfg.StrOpt('quantum_admin_password', help='password for connecting to quantum in admin context', secret=True), cfg.StrOpt('quantum_admin_tenant_name', help='tenant name for connecting to quantum in admin context'), cfg.StrOpt('quantum_region_name', help='region name for connecting to quantum in admin context'), cfg.StrOpt('quantum_admin_auth_url', default='http://localhost:5000/v2.0',