Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Ensure that the control exchange is set correctly
oslo_messaging.set_transport_defaults(control_exchange='neutron')
NOVA_CONF_SECTION = 'nova'
ks_loading.register_auth_conf_options(cfg.CONF, NOVA_CONF_SECTION)
ks_loading.register_session_conf_options(cfg.CONF, NOVA_CONF_SECTION)
# Register the nova configuration options
common_config.register_nova_opts()
ks_loading.register_auth_conf_options(cfg.CONF,
common_config.PLACEMENT_CONF_SECTION)
ks_loading.register_session_conf_options(cfg.CONF,
common_config.PLACEMENT_CONF_SECTION)
# Register the placement configuration options
common_config.register_placement_opts()
logging.register_options(cfg.CONF)
# Register the ironic configuration options
ks_loading.register_auth_conf_options(cfg.CONF,
common_config.IRONIC_CONF_SECTION)
ks_loading.register_session_conf_options(cfg.CONF,
common_config.IRONIC_CONF_SECTION)
common_config.register_ironic_opts()
def init(args, default_config_files=None, **kwargs):
:param group: Conf group, or string name thereof, in which to register the
options.
:param default_service_type: Default for the service_type conf option on
the Adapter.
:param include_auth: For service types where Nova is acting on behalf of
the user, auth should come from the user context.
In those cases, set this arg to False to avoid
registering ksa auth options.
:param deprecated_opts: dict of deprecated opts to register with the ksa
Session or Adapter opts. See docstring for
the deprecated_opts param of:
keystoneauth1.loading.session.Session.register_conf_options
"""
# ksa register methods need the group name as a string. oslo doesn't care.
group = getattr(group, 'name', group)
ks_loading.register_session_conf_options(
conf, group, deprecated_opts=deprecated_opts)
if include_auth:
ks_loading.register_auth_conf_options(conf, group)
conf.register_opts(get_ksa_adapter_opts(
default_service_type, deprecated_opts=deprecated_opts), group=group)
# Have to register dummies for the version-related opts we removed
for name in _ADAPTER_VERSION_OPTS:
conf.register_opt(_dummy_opt(name), group=group)
def register_opts(conf):
conf.register_group(cinder_group)
conf.register_opts(cinder_opts, group=cinder_group)
ks_loading.register_session_conf_options(conf,
cinder_group.name)
ks_loading.register_auth_conf_options(conf, cinder_group.name)
#
import decimal
from gnocchiclient import client as gclient
from keystoneauth1 import loading as ks_loading
from oslo_config import cfg
from oslo_utils import units
from cloudkitty import collector
from cloudkitty import utils as ck_utils
GNOCCHI_COLLECTOR_OPTS = 'gnocchi_collector'
gnocchi_collector_opts = ks_loading.get_auth_common_conf_options()
cfg.CONF.register_opts(gnocchi_collector_opts, GNOCCHI_COLLECTOR_OPTS)
ks_loading.register_session_conf_options(
cfg.CONF,
GNOCCHI_COLLECTOR_OPTS)
ks_loading.register_auth_conf_options(
cfg.CONF,
GNOCCHI_COLLECTOR_OPTS)
CONF = cfg.CONF
class GnocchiCollector(collector.BaseCollector):
collector_name = 'gnocchi'
dependencies = ('GnocchiTransformer',
'CloudKittyFormatTransformer')
retrieve_mappings = {
'compute': 'instance',
'image': 'image',
'volume': 'volume',
def register_keystoneauth_opts(conf, conf_group):
ks_loading.register_session_conf_options(conf, conf_group)
ks_loading.register_auth_conf_options(conf, conf_group)
def register_opts(conf):
conf.register_group(barbican_group)
conf.register_opts(barbican_opts, group=barbican_group)
conf.register_opts(engine_opts, group=engine_group)
conf.register_opts(jsonpath_opts, group=jsonpath_group)
conf.register_opts(default_opts)
ks_loading.register_auth_conf_options(conf, group='keystone_authtoken')
ks_loading.register_auth_conf_options(conf, group=barbican_group.name)
ks_loading.register_session_conf_options(conf, group=barbican_group.name)
def register_opts(conf):
conf.import_group(CFG_LEGACY_GROUP, 'keystonemiddleware.auth_token')
ka_loading.register_auth_conf_options(conf, CFG_GROUP)
ka_loading.register_session_conf_options(conf, CFG_GROUP)
conf.set_default('auth_type', default='password', group=CFG_GROUP)
def register_opts(conf):
conf.register_group(barbican_group)
conf.register_opts(barbican_opts, group=barbican_group)
ks_loading.register_session_conf_options(conf, barbican_group.name)
'os_ken.base.app_manager=INFO',
'os_ken.controller.controller=INFO',
'ovsdbapp.backend.ovs_idl.vlog=INFO'
]
# Register the configuration options
common_config.register_core_common_config_opts()
# Ensure that the control exchange is set correctly
oslo_messaging.set_transport_defaults(control_exchange='neutron')
NOVA_CONF_SECTION = 'nova'
ks_loading.register_auth_conf_options(cfg.CONF, NOVA_CONF_SECTION)
ks_loading.register_session_conf_options(cfg.CONF, NOVA_CONF_SECTION)
# Register the nova configuration options
common_config.register_nova_opts()
ks_loading.register_auth_conf_options(cfg.CONF,
common_config.PLACEMENT_CONF_SECTION)
ks_loading.register_session_conf_options(cfg.CONF,
common_config.PLACEMENT_CONF_SECTION)
# Register the placement configuration options
common_config.register_placement_opts()
logging.register_options(cfg.CONF)
# Register the ironic configuration options
cfg.DeprecatedOpt('ca_certificates_file', group=NOVA_GROUP),
cfg.DeprecatedOpt('nova_ca_certificates_file', group="DEFAULT"),
cfg.DeprecatedOpt('nova_ca_certificates_file', group=NOVA_GROUP),
],
'insecure': [
cfg.DeprecatedOpt('api_insecure', group="DEFAULT"),
cfg.DeprecatedOpt('api_insecure', group=NOVA_GROUP),
cfg.DeprecatedOpt('nova_api_insecure', group="DEFAULT"),
cfg.DeprecatedOpt('nova_api_insecure', group=NOVA_GROUP),
],
}
CONF = cfg.CONF
CONF.register_opts(core_opts)
CONF.register_opts(nova_opts, NOVA_GROUP)
ks_loading.register_session_conf_options(CONF,
NOVA_GROUP,
deprecated_opts=deprecated_opts)
ks_loading.register_auth_conf_options(CONF, NOVA_GROUP)
def list_opts():
return client_auth.AuthClientLoader.list_opts(NOVA_GROUP)
def novaclient(context):
global AUTH_OBJ
if not AUTH_OBJ:
AUTH_OBJ = client_auth.AuthClientLoader(
client_class=nova_client.Client,
exception_module=nova_exception,
cfg_group=NOVA_GROUP)