Revision a868c831 snf-cyclades-app/synnefo/volume/volumes.py

b/snf-cyclades-app/synnefo/volume/volumes.py
37 37
        source_type = "image"
38 38
        source_uuid = source_image_id
39 39
    else:
40
        source_type = source_uuid = None
40
        source_type = "blank"
41
        source_uuid = None
41 42

  
42 43
    volume = _create_volume(server, user_id, size, source_type, source_uuid,
43 44
                            name, description, index=None)
......
142 143

  
143 144

  
144 145
@transaction.commit_on_success
145
def rename(volume, new_name):
146
    volume.name = new_name
147
    volume.save()
148
    return volume
146
def update(volume, name=None, description=None, delete_on_termination=None):
147
    if name is not None:
148
        volume.name = name
149
    if description is not None:
150
        volume.description = description
151
    if delete_on_termination is not None:
152
        volume.delete_on_termination = delete_on_termination
149 153

  
150

  
151
@transaction.commit_on_success
152
def update_description(volume, new_description):
153
    volume.description = new_description
154 154
    volume.save()
155 155
    return volume

Also available in: Unified diff