Revision 482bc0c4 kamaki/clients/pithos/__init__.py
b/kamaki/clients/pithos/__init__.py | ||
---|---|---|
1109 | 1109 |
finally: |
1110 | 1110 |
self.container = cnt_back_up |
1111 | 1111 |
|
1112 |
def get_container_info(self, until=None): |
|
1112 |
def get_container_info(self, container=None, until=None):
|
|
1113 | 1113 |
""" |
1114 | 1114 |
:param until: (str) formated date |
1115 | 1115 |
|
... | ... | |
1117 | 1117 |
|
1118 | 1118 |
:raises ClientError: 404 Container not found |
1119 | 1119 |
""" |
1120 |
bck_cont = self.container |
|
1120 | 1121 |
try: |
1122 |
self.container = container or bck_cont |
|
1123 |
self._assert_container() |
|
1121 | 1124 |
r = self.container_head(until=until) |
1122 | 1125 |
except ClientError as err: |
1123 | 1126 |
err.details.append('for container %s' % self.container) |
1124 | 1127 |
raise err |
1128 |
finally: |
|
1129 |
self.container = bck_cont |
|
1125 | 1130 |
return r.headers |
1126 | 1131 |
|
1127 | 1132 |
def get_container_meta(self, until=None): |
... | ... | |
1131 | 1136 |
:returns: (dict) |
1132 | 1137 |
""" |
1133 | 1138 |
return filter_in( |
1134 |
self.get_container_info(until=until), |
|
1135 |
'X-Container-Meta') |
|
1139 |
self.get_container_info(until=until), 'X-Container-Meta') |
|
1136 | 1140 |
|
1137 | 1141 |
def get_container_object_meta(self, until=None): |
1138 | 1142 |
""" |
... | ... | |
1141 | 1145 |
:returns: (dict) |
1142 | 1146 |
""" |
1143 | 1147 |
return filter_in( |
1144 |
self.get_container_info(until=until), |
|
1145 |
'X-Container-Object-Meta') |
|
1148 |
self.get_container_info(until=until), 'X-Container-Object-Meta') |
|
1146 | 1149 |
|
1147 | 1150 |
def set_container_meta(self, metapairs): |
1148 | 1151 |
""" |
Also available in: Unified diff