Revision 6657ec8c
b/kamaki/clients/pithos.py | ||
---|---|---|
141 | 141 |
self.set_header('X-Account-Group-'+group, '') |
142 | 142 |
r = self.post(path, success=202) |
143 | 143 |
|
144 |
def get_account_info(self, until = None, if_modified_since=None, if_unmodified_since=None): |
|
145 |
""" @param until (string): optional timestamp |
|
146 |
@param if_modified_since (string): Retrieve if account has changed since provided timestamp |
|
147 |
@param if_unmodified_since (string): Retrieve if account has not changed since provided timestamp |
|
148 |
""" |
|
149 |
self.assert_account() |
|
150 |
path = path4url(self.account) |
|
151 |
|
|
152 |
path += '' if until is None else params4url({'until':until}) |
|
153 |
if if_modified_since is not None: |
|
154 |
self.set_header('If-Modified-Since', if_modified_since) |
|
155 |
if if_modified_since is not None: |
|
156 |
self.set_header('If-Unmodified-Since', if_unmodified_since) |
|
157 |
|
|
158 |
r = self.head(path, success=(204, 401)) |
|
159 |
if r.status_code == 401: |
|
160 |
raise ClientError("No authorization") |
|
161 |
return r.headers |
|
162 |
|
|
144 | 163 |
def get_account_quota(self): |
145 | 164 |
return filter_in(self.get_account_info(), 'X-Account-Policy-Quota', exactMatch = True) |
146 | 165 |
|
Also available in: Unified diff