Commit d3283dbd authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Demand a name for snapshots

parent 910df75d
...@@ -32,6 +32,9 @@ def create(user_id, volume, name, description, metadata, force=False): ...@@ -32,6 +32,9 @@ def create(user_id, volume, name, description, metadata, force=False):
""" """
if name is None:
raise faults.BadRequest("Snapshot 'name' is required")
# Check that taking a snapshot is feasible # Check that taking a snapshot is feasible
if volume.machine is None: if volume.machine is None:
raise faults.BadRequest("Cannot snapshot a detached volume!") raise faults.BadRequest("Cannot snapshot a detached volume!")
......
...@@ -265,8 +265,7 @@ def create_snapshot(request): ...@@ -265,8 +265,7 @@ def create_snapshot(request):
name = new_snapshot.get("display_name", None) name = new_snapshot.get("display_name", None)
if name is None: if name is None:
name = "snapshot_volume_%s_%s" %\ raise faults.BadRequest("Snapshot 'name' is required")
(volume.id, str(datetime.datetime.now()))
description = new_snapshot.get("display_description", "") description = new_snapshot.get("display_description", "")
# TODO: What to do with force ? # TODO: What to do with force ?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment