本文整理匯總了Python中swiftclient.Connection.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Connection.__init__方法的具體用法?Python Connection.__init__怎麽用?Python Connection.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類swiftclient.Connection
的用法示例。
在下文中一共展示了Connection.__init__方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from swiftclient import Connection [as 別名]
# 或者: from swiftclient.Connection import __init__ [as 別名]
def __init__(self, auth_url, user_name, key, logger, cache_file_path,
object_store_url=None, auth_version="2",
os_options=None):
socket.setdefaulttimeout(30.0) # timeout set at socket level
Connection.__init__(self, auth_url, user_name, key, retries=0,
os_options=os_options,
auth_version=auth_version)
# needed if keystone-get-token does not work
self.object_store_url = object_store_url
self.state = dict()
for sev in severities:
for component_name in self.component_names():
self.state[component_name + sev] = \
dict(current_state=component_states.unknown,
reason='',
metrics={})
self.latency = dict()
self.metric_data = []
self.latency_reset()
self.logger = logger
self.cache_file_path = cache_file_path