Revision 09458eac snf-cyclades-app/synnefo/plankton/backend.py
b/snf-cyclades-app/synnefo/plankton/backend.py | ||
---|---|---|
203 | 203 |
prefixed = {} |
204 | 204 |
for key, val in meta.items(): |
205 | 205 |
if key in PLANKTON_META or key.startswith(PROPERTY_PREFIX): |
206 |
prefixed[PLANKTON_PREFIX + key] = val |
|
206 |
k = PLANKTON_PREFIX + key |
|
207 |
v = str(val) |
|
208 |
if len(k) > 128: |
|
209 |
raise ValueError('Metadata keys should be less than 128 ' |
|
210 |
'characters') |
|
211 |
if len(v) > 256: |
|
212 |
raise ValueError('Metadata values should be less than 256 ' |
|
213 |
'characters.') |
|
214 |
prefixed[k] = v |
|
207 | 215 |
|
208 | 216 |
self.backend.update_object_meta(self.user, account, container, name, |
209 | 217 |
PLANKTON_DOMAIN, prefixed, replace) |
Also available in: Unified diff