Revision a868c831 snf-cyclades-app/synnefo/volume/views.py
b/snf-cyclades-app/synnefo/volume/views.py | ||
---|---|---|
202 | 202 |
|
203 | 203 |
new_name = req.get("display_name") |
204 | 204 |
description = req.get("display_description") |
205 |
delete_on_termination = req.get("delete_on_termination") |
|
205 | 206 |
|
206 |
if new_name is None and description is None: |
|
207 |
if new_name is None and description is None and\ |
|
208 |
delete_on_termination is None: |
|
207 | 209 |
raise faults.BadRequest("Nothing to update.") |
210 |
else: |
|
211 |
volume = volumes.update(volume, new_name, description, |
|
212 |
delete_on_termination) |
|
208 | 213 |
|
209 |
if new_name is not None: |
|
210 |
volume = volumes.rename(volume, new_name) |
|
211 |
if description is not None: |
|
212 |
volume = volumes.update_description(volume, description) |
|
213 | 214 |
data = json.dumps({'volume': volume_to_dict(volume, detail=True)}) |
214 | 215 |
return HttpResponse(data, content_type="application/json", status=200) |
215 | 216 |
|
Also available in: Unified diff