Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@removals.removed_kwarg("db", message="'db' parameter is deprecated "
"and will be removed in future. "
"Please specify 'db' in "
"'connection_string' instead.")
def __init__(self, connection_str, db=0, project=None,
service=None, host=None, conf=cfg.CONF, **kwargs):
"""Redis driver for OSProfiler."""
super(Redis, self).__init__(connection_str, project=project,
service=service, host=host,
conf=conf, **kwargs)
try:
from redis import StrictRedis
except ImportError:
raise exc.CommandError(
"To use OSProfiler with Redis driver, "
"please install `redis` library. "
@removals.removed_kwarg(
'enabled',
message='The enabled parameter is deprecated.',
version='3.18.0',
removal_version='4.0.0')
def update(self, region, description=None, enabled=None,
parent_region=None, **kwargs):
"""Update a region.
:param region: the region to be updated on the server.
:type region: str or :class:`keystoneclient.v3.regions.Region`
:param str description: the new description of the region.
:param bool enabled: determining if the region appears in the catalog
by enabling or disabling it.
:param parent_region: the new parent of the region in the hierarchy.
:type parent_region: str or :class:`keystoneclient.v3.regions.Region`
:param kwargs: any other attribute provided will be passed to server.
@removals.removed_kwarg('client_parameters')
def __init__(self, credentials, identity_uri, region=None, scope='project',
disable_ssl_certificate_validation=True, ca_certs=None,
trace_requests='', client_parameters=None, proxy_url=None):
"""Service Clients provider
Instantiate a `ServiceClients` object, from a set of credentials and an
identity URI. The identity version is inferred from the credentials
object. Optionally auth scope can be provided.
A few parameters can be given a value which is applied as default
for all service clients: region, dscv, ca_certs, trace_requests.
Parameters dscv, ca_certs and trace_requests all apply to the auth
provider as well as any service clients provided by this manager.
Any other client parameter should be set via ClientsRegistry.
@removals.removed_kwarg(
'enabled',
message='The enabled parameter is deprecated.',
version='3.18.0',
removal_version='4.0.0')
def create(self, id=None, description=None, enabled=True,
parent_region=None, **kwargs):
"""Create a region.
:param str id: the unique identifier of the region. If not specified an
ID will be created by the server.
:param str description: the description of the region.
:param bool enabled: whether the region is enabled or not, determining
if it appears in the catalog.
:param parent_region: the parent of the region in the hierarchy.
:type parent_region: str or :class:`keystoneclient.v3.regions.Region`
:param kwargs: any other attribute provided will be passed to the
@removals.removed_kwarg("db", message="'db' parameter is deprecated "
"and will be removed in future. "
"Please specify 'db' in "
"'connection_string' instead.")
def __init__(self, connection_str, db=0, project=None,
service=None, host=None, conf=cfg.CONF, **kwargs):
"""Redis driver for OSProfiler."""
super(RedisSentinel, self).__init__(connection_str, project=project,
service=service, host=host,
conf=conf, **kwargs)
try:
from redis.sentinel import Sentinel
except ImportError:
raise exc.CommandError(
"To use this command, you should install "
"'redis' manually. Use command:\n "
@removals.removed_kwarg('timeout', version="0.8", removal_version="2.0")
def stop(self, timeout=None):
"""Requests the conductor to stop dispatching.
This method can be used to request that a conductor stop its
consumption & dispatching loop.
The method returns immediately regardless of whether the conductor has
been stopped.
.. deprecated:: 0.8
The ``timeout`` parameter is **deprecated** and is present for
backward compatibility **only**. In order to wait for the
conductor to gracefully shut down, :py:meth:`wait` should be used
instead.
"""
@removals.removed_kwarg('tombstone', version="0.8", removal_version="?")
def __init__(self, callables, tombstone=None):
if tombstone is None:
self._tombstone = tu.Event()
else:
self._tombstone = tombstone
self._callables = []
for i, cb in enumerate(callables, 1):
if not six.callable(cb):
raise ValueError("Periodic callback %s must be callable" % i)
missing_attrs = _check_attrs(cb)
if missing_attrs:
raise ValueError("Periodic callback %s missing required"
" attributes %s" % (i, missing_attrs))
if cb._periodic:
self._callables.append(cb)
self._immediates, self._schedule = _build(self._callables)
@removals.removed_kwarg('recursive', version="0.11", removal_version="2.0")
def ls(self, path, recursive=False):
"""Return list of all children of the given path.
NOTE(harlowja): if ``recursive`` is passed in as truthy then the
absolute path is **always** returned (not the relative path). If
``recursive`` is left as the default or falsey then the
relative path is **always** returned.
This is documented in bug `1458114`_ and the existing behavior is
being maintained, to get a recursive version that is absolute (or is
not absolute) it is recommended to use the :py:meth:`.ls_r` method
instead.
.. deprecated:: 0.11
In a future release the ``recursive`` keyword argument will