Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@debtcollector.renames.renamed_kwarg(
'tenant_name', 'project_name', replace=True)
def construct_http_client(username=None,
user_id=None,
project_name=None,
project_id=None,
password=None,
auth_url=None,
token=None,
region_name=None,
timeout=None,
endpoint_url=None,
insecure=False,
endpoint_type='public',
log_credentials=None,
auth_strategy='keystone',
ca_cert=None,
@debtcollector.renames.renamed_kwarg(
'tenant_name', 'project_name', replace=True)
def __init__(self, username=None, user_id=None,
project_name=None, project_id=None,
password=None, auth_url=None,
token=None, region_name=None, timeout=None,
endpoint_url=None, insecure=False,
endpoint_type='publicURL',
auth_strategy='keystone', ca_cert=None, log_credentials=False,
service_type='network', global_request_id=None,
**kwargs):
self.username = username
self.user_id = user_id
self.project_name = project_name
self.project_id = project_id
self.password = password
@debtcollector.renames.renamed_kwarg(
"idle_timeout", "connection_recycle_time", replace=True)
def configure_defaults(self, **kw):
"""Apply default configurational options.
This method can only be called before any specific
transaction-beginning methods have been called.
Configurational options are within a fixed set of keys, and fall
under three categories: URL configuration, engine configuration,
and session configuration. Each key given will be tested against
these three configuration sets to see which one is applicable; if
it is not applicable to any set, an exception is raised.
The configurational options given here act as **defaults**
when the :class:`._TransactionFactory` is configured using
a :class:`oslo_config.cfg.ConfigOpts` object; the options
def getter(self):
_moved_msg(new_name, old_name)
return getattr(self, target)
def setter(self, value):
_moved_msg(new_name, old_name)
setattr(self, target, value)
def deleter(self):
_moved_msg(new_name, old_name)
delattr(self, target)
return property(getter, setter, deleter)
_renamed_kwarg = functools.partial(renames.renamed_kwarg,
version='2.18',
removal_version='3.0',
replace=True)
class RequestContext(object):
"""Helper class to represent useful information about a request context.
Stores information about the security context under which the user
accesses the system, as well as additional request information.
"""
user_idt_format = u'{user} {tenant} {domain} {user_domain} {p_domain}'
# Can be overridden in subclasses to specify extra keys that should be
# read when constructing a context using from_dict.
@renames.renamed_kwarg('project', 'default_project', version='1.7.0',
removal_version='2.0.0')
def create(self, name, domain=None, project=None, password=None,
email=None, description=None, enabled=True,
default_project=None, **kwargs):
"""Create a user.
:param str name: the name of the user.
:param domain: the domain of the user.
:type domain: str or :class:`keystoneclient.v3.domains.Domain`
:param project: the default project of the user.
(deprecated, see warning below)
:type project: str or :class:`keystoneclient.v3.projects.Project`
:param str password: the password for the user.
:param str email: the email address of the user.
:param str description: a description of the user.
:param bool enabled: whether the user is enabled.
@renames.renamed_kwarg('tenant_id', 'project_id', version='1.7.0',
removal_version='2.0.0')
def __init__(self, username=None, tenant_id=None, tenant_name=None,
password=None, auth_url=None, region_name=None, endpoint=None,
token=None, auth_ref=None, use_keyring=False,
force_new_token=False, stale_duration=None, user_id=None,
user_domain_id=None, user_domain_name=None, domain_id=None,
domain_name=None, project_id=None, project_name=None,
project_domain_id=None, project_domain_name=None,
trust_id=None, session=None, service_name=None,
interface='admin', endpoint_override=None, auth=None,
user_agent=USER_AGENT, connect_retries=None, **kwargs):
# set baseline defaults
self.user_id = None
self.username = None
self.user_domain_id = None
self.user_domain_name = None
@renames.renamed_kwarg('tenant_name', 'project_name', version='1.7.0',
removal_version='2.0.0')
@renames.renamed_kwarg('tenant_id', 'project_id', version='1.7.0',
removal_version='2.0.0')
def __init__(self, username=None, tenant_id=None, tenant_name=None,
password=None, auth_url=None, region_name=None, endpoint=None,
token=None, auth_ref=None, use_keyring=False,
force_new_token=False, stale_duration=None, user_id=None,
user_domain_id=None, user_domain_name=None, domain_id=None,
domain_name=None, project_id=None, project_name=None,
project_domain_id=None, project_domain_name=None,
trust_id=None, session=None, service_name=None,
interface='admin', endpoint_override=None, auth=None,
user_agent=USER_AGENT, connect_retries=None, **kwargs):
# set baseline defaults
self.user_id = None
self.username = None
@debtcollector.renames.renamed_kwarg(
"idle_timeout", "connection_recycle_time", replace=True)
def configure(self, **kw):
"""Apply configurational options.
This method can only be called before any specific
transaction-beginning methods have been called.
Behavior here is the same as that of
:meth:`._TransactionFactory.configure_defaults`,
with the exception that values specified here will **supersede** those
setup in the :class:`oslo_config.cfg.ConfigOpts` options. See
that method for a listing of all keyword arguments.
.. seealso::
:meth:`._TransactionFactory.configure_defaults`
@debtcollector.renames.renamed_kwarg(
"idle_timeout", "connection_recycle_time", replace=True)
def create_engine(sql_connection, sqlite_fk=False, mysql_sql_mode=None,
mysql_enable_ndb=False,
connection_recycle_time=3600,
connection_debug=0, max_pool_size=None, max_overflow=None,
pool_timeout=None, sqlite_synchronous=True,
connection_trace=False, max_retries=10, retry_interval=10,
thread_checkin=True, logging_name=None,
json_serializer=None,
json_deserializer=None, connection_parameters=None):
"""Return a new SQLAlchemy engine."""
url = sqlalchemy.engine.url.make_url(sql_connection)
if connection_parameters:
_extend_url_parameters(url, connection_parameters)
@debtcollector.renames.renamed_kwarg(
'tenant_id', 'project_id', replace=True)
def show_quota_details(self, project_id, **_params):
"""Fetch information of a certain project's quota details."""
return self.get(self.quota_details_path % (project_id),
params=_params)