glance_store._drivers.swift.connection_manager
Module¶Connection Manager for Swift connections that responsible for providing connection with valid credentials and updated token
glance_store._drivers.swift.connection_manager.
MultiTenantConnectionManager
(store, store_location, context=None, allow_reauth=False)¶Bases: glance_store._drivers.swift.connection_manager.SwiftConnectionManager
glance_store._drivers.swift.connection_manager.
SingleTenantConnectionManager
(store, store_location, context=None, allow_reauth=False)¶Bases: glance_store._drivers.swift.connection_manager.SwiftConnectionManager
glance_store._drivers.swift.connection_manager.
SwiftConnectionManager
(store, store_location, context=None, allow_reauth=False)¶Bases: object
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.
AUTH_HEADER_NAME
= 'X-Auth-Token'¶client
¶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.
get_connection
()¶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.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.