Revision 94bedc5b kamaki/clients/storage/__init__.py
b/kamaki/clients/storage/__init__.py | ||
---|---|---|
161 | 161 |
content_type='application/octet-stream', content_length=0): |
162 | 162 |
""" |
163 | 163 |
:param obj: (str) directory-object name |
164 |
|
|
164 | 165 |
:param content_type: (str) explicitly set content_type |
166 |
|
|
165 | 167 |
:param content_length: (int) explicitly set content length |
168 |
|
|
169 |
:returns: (dict) object creation headers |
|
166 | 170 |
""" |
167 | 171 |
self._assert_container() |
168 | 172 |
path = path4url(self.account, self.container, obj) |
169 | 173 |
self.set_header('Content-Type', content_type) |
170 | 174 |
self.set_header('Content-length', str(content_length)) |
171 |
self.put(path, success=201) |
|
175 |
r = self.put(path, success=201) |
|
176 |
return r.headers |
|
172 | 177 |
|
173 | 178 |
def create_directory(self, obj): |
174 | 179 |
""" |
175 | 180 |
:param obj: (str) directory-object name |
181 |
|
|
182 |
:returns: (dict) request headers |
|
176 | 183 |
""" |
177 | 184 |
self._assert_container() |
178 | 185 |
path = path4url(self.account, self.container, obj) |
179 | 186 |
self.set_header('Content-Type', 'application/directory') |
180 | 187 |
self.set_header('Content-length', '0') |
181 |
self.put(path, success=201) |
|
188 |
r = self.put(path, success=201) |
|
189 |
return r.headers |
|
182 | 190 |
|
183 | 191 |
def get_object_info(self, obj): |
184 | 192 |
""" |
Also available in: Unified diff