Libraries common throughout Cinder or just ones that haven’t been categorized very well yet.
RequestContext: context for requests that persist through all of cinder.
Bases: object
Security context and request information.
Represents the user taking a given action within the system.
Return a version of this context with admin flag set.
Cinder base exception handling.
Includes decorator for re-raising Cinder-type exceptions.
SHOULD include dedicated exception logging.
Bases: cinder.exception.NotAuthorized
Bases: cinder.exception.CinderException
Bases: cinder.exception.NotFound
Bases: cinder.exception.BackupDriverException
Bases: cinder.exception.BackupDriverException
Bases: cinder.exception.NotFound
Bases: cinder.exception.Invalid
Bases: cinder.exception.BackupDriverException
Bases: cinder.exception.ZadaraException
Bases: cinder.exception.CinderException
Bases: exceptions.Exception
Base Cinder Exception
To correctly use this class, inherit from it and define a ‘message’ property. That message will get printf’d with the keyword arguments provided to the constructor.
Bases: cinder.exception.NotFound
Bases: webob.exc.WSGIHTTPException
Bases: cinder.exception.CoraidException
Bases: cinder.exception.CoraidException
Bases: cinder.exception.CoraidException
Bases: cinder.exception.CoraidException
Bases: cinder.exception.CoraidException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.CoraidException
Bases: cinder.exception.Invalid
Bases: cinder.exception.CinderException
Bases: cinder.exception.Duplicate
Bases: exceptions.Exception
Bases: cinder.exception.Invalid
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.NotFound
Bases: cinder.exception.CinderException
Bases: cinder.exception.Invalid
Bases: cinder.exception.NotFound
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.HPMSAVolumeDriverException
Bases: cinder.exception.HPMSAVolumeDriverException
Bases: cinder.exception.HPMSAVolumeDriverException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.NotFound
Bases: cinder.exception.NotFound
Bases: cinder.exception.NotFound
Bases: cinder.exception.Invalid
Bases: cinder.exception.CinderException
Bases: cinder.exception.NotFound
Bases: cinder.exception.Invalid
Bases: cinder.exception.CinderException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.Invalid
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.CinderException
No more available targets.
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.NotFound
Bases: cinder.exception.NotFound
Bases: cinder.exception.NotAuthorized
Bases: cinder.exception.QuotaNotFound
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.Duplicate
Bases: cinder.exception.CinderException
Bases: cinder.exception.NotFound
Bases: cinder.exception.NotFound
Bases: cinder.exception.CinderException
Bases: cinder.exception.QuotaNotFound
Bases: cinder.exception.CinderException
Bases: cinder.exception.NotFound
Bases: cinder.exception.QuotaNotFound
Bases: cinder.exception.QuotaNotFound
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.QuotaNotFound
Bases: cinder.exception.CinderException
Bases: cinder.exception.NotFound
Bases: cinder.exception.NotFound
Bases: cinder.exception.NotFound
Bases: cinder.exception.Invalid
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.QuotaError
Bases: cinder.exception.NotFound
Bases: cinder.exception.NotFound
Bases: cinder.exception.SolidFireAPIException
Bases: cinder.exception.VolumeBackendAPIException
Bases: cinder.exception.SolidFireDriverException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.BackupDriverException
Bases: cinder.exception.NotFound
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.NotFound
Bases: cinder.exception.Invalid
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.CinderException
Bases: cinder.exception.QuotaError
Bases: cinder.exception.BackupDriverException
Bases: cinder.exception.NotFound
Bases: cinder.exception.CinderException
Bases: cinder.exception.NotFound
Bases: cinder.exception.QuotaError
Bases: cinder.exception.CinderException
Bases: cinder.exception.Invalid
Bases: cinder.exception.NotFound
Bases: cinder.exception.Duplicate
Bases: cinder.exception.NotFound
Bases: cinder.exception.CinderException
Bases: cinder.exception.NotFound
Bases: cinder.exception.VolumeTypeNotFound
Bases: cinder.exception.ZadaraException
Bases: cinder.exception.VolumeDriverException
Bases: cinder.exception.ZadaraException
Bases: cinder.exception.ZadaraException
Bases: cinder.exception.ZadaraException
Bases: cinder.exception.ZadaraException
Bases: cinder.exception.CinderException
Command-line flag library.
Emulates gflags by wrapping cfg.ConfigOpts.
The idea is to move fully to cfg eventually, and this wrapper is a stepping stone.
Bases: oslo.messaging.serializer.Serializer
Utilities and helper functions.
Bases: object
A pluggable backend loaded lazily based on some value.
Bases: xml.sax.expatreader.ExpatParser
An expat parser which disables DTD’s and entities by default.
Bases: eventlet.pools.Pool
A simple eventlet pool to hold ssh connections.
Return an item from the pool, when one is available.
This may cause the calling greenthread to block. Check if a connection is active before returning it.
For dead connections create and return a new connection.
Close an ssh client and remove it from free_items.
Add user-visible admin metadata to regular metadata.
Extracts the admin metadata keys that are to be made visible to non-administrators, and adds them to the regular metadata structure for the passed-in volume.
Wrapper to get a brick connector object. This automatically populates the required protocol as well as the root_helper needed to execute commands.
wrapper for the brick calls to automatically set the root_helper needed for cinder.
Checks that only one of the provided options is actually not-none.
Iterates over all the kwargs passed in and checks that only one of said arguments is not-none, if more than one is not-none then an exception will be raised with the names of those arguments who were not-none.
Check the length of specified string :param value: the value of the string :param name: the name of the string :param min_length: the min_length of the string :param max_length: the max_length of the string
Invoke an interactive shell session on server.
Convenience wrapper around oslo’s execute() method.
Find a configuration file using the given hint.
Parameters: | config_path – Full or relative path to the config. |
---|---|
Returns: | Full path of the config, if it exists. |
Raises: | cinder.exception.ConfigNotFound |
Generate the URL to glance.
Generate a random password from the supplied symbol groups.
At least one symbol from each group will be included. Unpredictable results if length is less than the number of symbol groups.
Believed to be reasonably secure (with a reasonable password length!)
This primarily exists to make unit testing easier.
This primarily exists to make unit testing easier.
Returns a list of items matching the specified path.
Takes an XPath-like expression e.g. prop1/prop2/prop3, and for each item in items, looks up items[prop1][prop2][prop3]. Like XPath, if any of the intermediate results are lists it will treat each list item individually. A ‘None’ in items or any child expressions will be ignored, this function will not throw because of None (anywhere) in items. The returned list will contain no None values.
Generate a hash for the contents of a file.
Check if the provided string is a valid bool string or not.
This method gives you the most recently completed audit period.
Return a path to a particular device.
>>> make_dev_path('xvdc')
/dev/xvdc
>>> make_dev_path('xvdc', 1)
/dev/xvdc1
If the CONF.monkey_patch set as True, this function patches a decorator for all functions in specified modules.
You can set decorators for each modules using CONF.monkey_patch_modules. The format is “Module path:Decorator function”. Example: ‘cinder.api.ec2.cloud:’ cinder.openstack.common.notifier.api.notify_decorator’
Parameters of the decorator is as follows. (See cinder.openstack.common.notifier.api.notify_decorator)
name - name of the function function - object of the function
Read from a file if it has been modified.
Parameters: |
|
---|---|
Returns: | data from file |
Secure helper to read file as root.
Verifies if driver is initialized
If the driver is not initialized, an exception will be raised.
Params driver: | The driver instance. |
---|---|
Raises: | exception.DriverNotInitialized |
Parse an XML string using minidom safely.
Return a hostname which conforms to RFC-952 and RFC-1123 specs.
Check whether a service is up based on last heartbeat.
Temporarily chown a path.
Params owner_uid: | |
---|---|
UID of temporary owner (defaults to current user) |
Local total_seconds implementation for compatibility with python 2.6.
Walk class hierarchy, yielding most derived classes first.
Escapes a string so it is valid within XML or XHTML.
Utility methods for working with WSGI servers.
Bases: object
Base WSGI application wrapper. Subclasses need to implement __call__.
Used for paste app factories in paste.deploy config files.
Any local configuration (that is, values under the [app:APPNAME] section of the paste config) will be passed into the __init__ method as kwargs.
A hypothetical configuration would look like:
[app:wadl] latest_version = 1.3 paste.app_factory = cinder.api.fancy_api:Wadl.factory
which would result in a call to the Wadl class as
import cinder.api.fancy_api fancy_api.Wadl(latest_version=‘1.3’)
You could of course re-implement the factory method in subclasses, but using the kwarg passing it shouldn’t be necessary.
Bases: cinder.wsgi.Middleware
Helper class for debugging a WSGI application.
Can be inserted into any WSGI application chain to get information about the request and response.
Iterator that prints the contents of a wrapper string.
Bases: object
Used to load WSGI applications from paste configurations.
Return the paste URLMap wrapped WSGI application.
Parameters: | name – Name of the application to load. |
---|---|
Returns: | Paste URLMap object wrapping the requested application. |
Raises: | cinder.exception.PasteAppNotFound |
Bases: cinder.wsgi.Application
Base WSGI middleware.
These classes require an application to be initialized that will be called next. By default the middleware will simply call its wrapped app, or you can override __call__ to customize its behavior.
Used for paste app factories in paste.deploy config files.
Any local configuration (that is, values under the [filter:APPNAME] section of the paste config) will be passed into the __init__ method as kwargs.
A hypothetical configuration would look like:
[filter:analytics] redis_host = 127.0.0.1 paste.filter_factory = cinder.api.analytics:Analytics.factory
which would result in a call to the Analytics class as
import cinder.api.analytics analytics.Analytics(app_from_paste, redis_host=‘127.0.0.1’)
You could of course re-implement the factory method in subclasses, but using the kwarg passing it shouldn’t be necessary.
Called on each request.
If this returns None, the next application down the stack will be executed. If it returns a response then that response will be returned and execution will stop here.
Do whatever you’d like to the response.
Bases: webob.request.Request
Bases: object
WSGI middleware that maps incoming requests to WSGI apps.
Bases: object
Server class to manage a WSGI server, serving a WSGI application.
Start serving a WSGI application.
Parameters: | backlog – Maximum number of queued connections. |
---|---|
Returns: | None |
Raises: | cinder.exception.InvalidInput |
Stop this server.
This is not a very nice action, as currently the method by which a server is stopped is by killing its eventlet.
Returns: | None |
---|
Block, until the server has stopped.
Waits on the server’s eventlet to finish, then returns.
Returns: | None |
---|