Module Expr Str Import alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr AttributeLoad AttributeLoad NameLoad attr attr If Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr AttributeLoad NameLoad attr Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Pass decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Str If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body TryExcept body Return Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad name NameStore body Assign NameStore BinOpMod Call NameLoad Str Call AttributeLoad NameLoad attr NameLoad Raise Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr orelse Assign AttributeStore NameLoad attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad Str Raise Call AttributeLoad NameLoad attr keyword Str keyword NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad NameLoad attr Str NameLoad Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body TryExcept body Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A Connection Manager for Swift connections that responsible for providing
connection with valid credentials and updated token N/A logging keystoneclient exceptions ks_exceptions oslo_utils encodeutils glance_store exceptions glance_store.i18n _ glance_store.i18n _LI N/A LOG N/A N/A logging getLogger __name__ SwiftConnectionManager N/A object N/A N/A Connection Manager class responsible for initializing and managing
    swiftclient connections in store. The instance of that class can provide
    swift connections with a valid(and refreshed) user token if the token is
    going to expire soon.
     N/A AUTH_HEADER_NAME X-Auth-Token __init__ N/A N/A self store store_location context allow_reauth N/A None False N/A N/A Initialize manager with parameters required to establish connection.

        Initialize store and prepare it for interacting with swift. Also
        initialize keystone client that need to be used for authentication if
        allow_reauth is True.
        The method invariant is the following: if method was executed
        successfully and self.allow_reauth is True users can safely request
        valid(no expiration) swift connections any time. Otherwise, connection
        manager initialize a connection once and always returns that connection
        to users.

        :param store: store that provides connections
        :param store_location: image location in store
        :param context: user context to access data in Swift
        :param allow_reauth: defines if re-authentication need to be executed
        when a user request the connection
         N/A N/A self _client None N/A N/A self store store N/A N/A self location store_location N/A N/A self context context N/A N/A self allow_reauth allow_reauth N/A N/A self storage_url N/A N/A self _get_storage_url N/A N/A self connection N/A N/A self _init_connection N/A get_connection N/A N/A self N/A N/A N/A Get swift client connection.

        Returns swift client connection. If allow_reauth is True and
        connection token is going to expire soon then the method returns
        updated connection.
        The method invariant is the following: if self.allow_reauth is False
        then the method returns the same connection for every call. So the
        connection may expire. If self.allow_reauth is True the returned
        swift connection is always valid and cannot expire at least for
        swift_store_expire_soon_interval.
         N/A N/A self allow_reauth N/A N/A auth_ref N/A N/A N/A N/A N/A self client session auth get_auth_ref N/A N/A self client session N/A N/A N/A auth_ref will_expire_soon N/A N/A N/A N/A self store conf glance_store swift_store_expire_soon_interval N/A N/A N/A N/A LOG info N/A _LI Requesting new token for swift connection. N/A auth_token N/A N/A N/A N/A N/A N/A self client session get_auth_headers get N/A self AUTH_HEADER_NAME N/A N/A N/A LOG info N/A _LI Token has been successfully requested. Refreshing swift connection. N/A N/A self connection N/A N/A N/A self store get_store_connection auth_token N/A self storage_url N/A N/A self connection N/A client N/A N/A self N/A N/A N/A Return keystone client to request a  new token.

        Initialize a client lazily from the method provided by glance_store.
        The method invariant is the following: if client cannot be
        initialized raise exception otherwise return initialized client that
        can be used for re-authentication any time.
         N/A N/A N/A self _client None N/A N/A N/A self _client N/A N/A self _init_client N/A N/A self _client N/A property _init_connection N/A N/A self N/A N/A N/A Initialize and return valid Swift connection. N/A auth_token N/A N/A N/A N/A N/A N/A self client session get_auth_headers get N/A self AUTH_HEADER_NAME N/A N/A N/A N/A self store get_store_connection auth_token N/A self storage_url N/A _init_client N/A N/A self N/A N/A N/A Initialize Keystone client. N/A N/A N/A N/A self store init_client location N/A self location context N/A self context N/A _get_storage_url N/A N/A self N/A N/A N/A Request swift storage url. N/A N/A NotImplementedError N/A __enter__ N/A N/A self N/A N/A N/A self N/A __exit__ N/A N/A self exc_type exc_val exc_tb N/A N/A N/A N/A N/A SingleTenantConnectionManager N/A SwiftConnectionManager N/A _get_storage_url N/A N/A self N/A N/A N/A Get swift endpoint from keystone

        Return endpoint for swift from service catalog. The method works only
        Keystone v3. If you are using different version (1 or 2)
        it returns None.
        :return: swift endpoint
         N/A N/A N/A N/A self store auth_version 3 N/A N/A N/A N/A N/A N/A N/A N/A self client session get_endpoint service_type N/A N/A self store service_type interface N/A N/A self store endpoint_type region_name N/A N/A self store region N/A N/A N/A Exception N/A e N/A N/A msg N/A N/A _ Cannot find swift service endpoint : %s N/A N/A encodeutils exception_to_unicode e N/A N/A N/A exceptions BackendException msg N/A _init_connection N/A N/A self N/A N/A N/A N/A N/A N/A self store auth_version 3 N/A N/A N/A N/A N/A super SingleTenantConnectionManager self _init_connection N/A N/A N/A self allow_reauth False N/A N/A N/A N/A self store get_connection N/A self location N/A self context N/A N/A MultiTenantConnectionManager N/A SwiftConnectionManager N/A __init__ N/A N/A self store store_location context allow_reauth N/A None False N/A N/A N/A context None N/A N/A reason N/A _ Multi-tenant Swift storage requires a user context. N/A N/A N/A exceptions BadStoreConfiguration store_name swift reason reason N/A N/A N/A N/A super MultiTenantConnectionManager self __init__ store store_location context allow_reauth N/A __exit__ N/A N/A self exc_type exc_val exc_tb N/A N/A N/A N/A N/A self _client N/A N/A self client trust_id N/A N/A N/A N/A LOG info N/A _LI Revoking trust %s N/A N/A self client trust_id N/A N/A N/A N/A N/A self client trusts delete N/A N/A self client trust_id N/A _get_storage_url N/A N/A self N/A N/A N/A N/A N/A N/A N/A N/A self store _get_endpoint N/A self context N/A N/A N/A N/A N/A exceptions BadStoreConfiguration N/A ks_exceptions EndpointNotFound N/A e N/A N/A N/A N/A LOG debug Cannot obtain endpoint from context: %s. Use location value from database to obtain swift_url. e N/A N/A N/A self location swift_url N/A _init_connection N/A N/A self N/A N/A N/A N/A self allow_reauth N/A N/A N/A N/A N/A N/A N/A super MultiTenantConnectionManager self _init_connection N/A N/A N/A Exception N/A e N/A N/A N/A N/A LOG debug Cannot initialize swift connection for multi-tenant store with trustee token: %s. Using user token for connection initialization. e N/A N/A self allow_reauth False N/A N/A N/A N/A self store get_store_connection N/A N/A self context auth_token N/A self storage_url N/A N/A