Libraries common throughout Manila or just ones that haven’t yet been categorized in depth.
RequestContext: context for requests that persist through all of manila.
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.
Manila base exception handling.
Includes decorator for re-raising Manila-type exceptions.
SHOULD include dedicated exception logging.
Bases: manila.exception.NotAuthorized
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.NotFound
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: webob.exc.WSGIHTTPException
Bases: manila.exception.ManilaException
Bases: manila.exception.Invalid
Bases: exceptions.Exception
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: oslo_concurrency.processutils.ProcessExecutionError
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.Invalid
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.InvalidShare
Bases: exceptions.Exception
Base Manila 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: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.MigrationNotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.NetworkException
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.NotAuthorized
Bases: manila.exception.QuotaError
Bases: manila.exception.QuotaNotFound
Bases: manila.exception.QuotaNotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Quobyte backend specific exception.
Bases: manila.exception.QuotaNotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.QuotaNotFound
Bases: manila.exception.QuotaNotFound
Bases: manila.exception.QuotaNotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.NotFound
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.ServiceInstanceException
Bases: manila.exception.Invalid
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.QuotaError
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.QuotaError
Bases: manila.exception.InUse
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.ShareServerNotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.QuotaError
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.ManilaException
Bases: manila.exception.NotFound
Bases: manila.exception.ShareTypeNotFound
Bases: manila.exception.QuotaError
Bases: manila.exception.StorageResourceNotFound
Bases: manila.exception.QuotaError
Bases: manila.exception.StorageResourceException
Bases: manila.exception.ManilaException
Bases: manila.exception.StorageResourceException
Bases: manila.exception.InvalidShare
Bases: manila.exception.Invalid
Bases: manila.exception.NotFound
Bases: manila.exception.NotFound
Bases: manila.exception.NetAppException
Bases: manila.exception.NetAppException
Bases: manila.exception.ManilaException
Base classes for our unit tests.
Allows overriding of flags for use of fakes, and some black magic for inline callbacks.
Bases: fixtures.fixture.Fixture
Bases: oslotest.base.BaseTestCase
Test case base class for all unit tests.
Assert a list of dicts are equivalent.
Assert two dicts are equivalent.
This is a ‘deep’ match in the sense that it handles nested dictionaries appropriately.
NOTE:
If you don’t care (or don’t know) a given value, you can specify the string DONTCARE as the value. This will cause that dict-item to be skipped.
Python < v2.7 compatibility. Assert ‘a’ in ‘b’.
Python < v2.7 compatibility.
Python < v2.7 compatibility.
Python < v2.7 compatibility. Assert ‘a’ NOT in ‘b’.
Assert a sub_dict is subset of super_dict.
Override flag variables for a test.
Use python mock to mock a class
Mocks the specified objects attribute with the given value. Automatically performs ‘addCleanup’ for the mock.
Use python mock to mock an object attribute
Mocks the specified objects attribute with the given value. Automatically performs ‘addCleanup’ for the mock.
Run before each test method to initialize test environment.
Runs after each test method to tear down test environment.
Utilities and helper functions.
Bases: object
Bases: object
Bases: object
A pluggable backend loaded lazily based on some value.
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.
Convert cidr to netmask.
Delete a file, but ignore file not found error.
Create a directory (and any ancestor directories required)
Parameters: | path – Directory to create |
---|
Convenience wrapper around oslo’s execute() function.
Open file
see built-in file() documentation for more details
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.
Check if eventlet support IPv6 addresses.
See https://bitbucket.org/eventlet/eventlet/issue/105
Return type: | bool |
---|
Check if system contain IPv6 capable network interface.
Return type: | bool |
---|---|
Raises: | IOError |
Patch decorator.
If the Flags.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: ‘manila.api.ec2.cloud:’ manila.openstack.common.notifier.api.notify_decorator’
Parameters of the decorator is as follows. (See manila.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.
A wrapper around retrying library.
This decorator allows to log and to check ‘retries’ input param. Time interval between retries is calculated in the following way: interval * backoff_rate ^ previous_attempt_number
Parameters: |
|
---|
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) |
Convenience wrapper around oslo’s trycmd() function.
Walk class hierarchy, yielding most derived classes first.
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 = manila.api.fancy_api:Wadl.factory
which would result in a call to the Wadl class as
import manila.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: manila.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: | manila.exception.PasteAppNotFound |
Bases: manila.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 = manila.api.analytics:Analytics.factory
which would result in a call to the Analytics class as
import manila.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: oslo_service.service.ServiceBase
Server class to manage a WSGI server, serving a WSGI application.
Reset server greenpool size to default.
Returns: | None |
---|
Start serving a WSGI application.
Returns: | None |
---|---|
Raises: | manila.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 |
---|
Bases: object
Acts like the manila.openstack.common.notifier.api module.
Bases: manila.test.TestCase
Bases: manila.test.TestCase
Bases: manila.test.TestCase
Bases: manila.test.TestCase
Bases: manila.test.TestCase