Revision 5509b599

b/api/actions.py
253 253
    vm = get_vm(server_id, request.user)
254 254
    net.machines.add(vm)
255 255
    net.save()
256
    vm.save()
256 257
    return HttpResponse(status=202)
257 258

  
258 259
@network_action('remove')
......
272 273
    vm = get_vm(server_id, request.user)
273 274
    net.machines.remove(vm)
274 275
    net.save()
276
    vm.save()
275 277
    return HttpResponse(status=202)
b/api/images.py
219 219
            updated[key] = val
220 220
        except ImageMetadata.DoesNotExist:
221 221
            pass    # Ignore non-existent metadata
222

  
222
    
223
    if updated:
224
        image.save()
225
    
223 226
    return render_metadata(request, updated, status=201)
224 227

  
225 228
@api_method('GET')
......
261 264
    meta, created = ImageMetadata.objects.get_or_create(meta_key=key, image=image)
262 265
    meta.meta_value = metadict[key]
263 266
    meta.save()
267
    image.save()
264 268
    return render_meta(request, meta, status=201)
265 269

  
266 270
@api_method('DELETE')
......
278 282
    image = get_image(image_id, request.user)
279 283
    meta = get_image_meta(image, key)
280 284
    meta.delete()
285
    image.save()
281 286
    return HttpResponse(status=204)
b/api/networks.py
148 148
    #                       overLimit (413)
149 149

  
150 150
    net = get_network(network_id, request.user)
151
    for vm in net.machines.all():
152
        vm.save()
151 153
    net.delete()
152 154
    return HttpResponse(status=204)
153 155

  
b/api/servers.py
344 344
            updated[key] = val
345 345
        except VirtualMachineMetadata.DoesNotExist:
346 346
            pass    # Ignore non-existent metadata
347

  
347
    
348
    if updated:
349
        vm.save()
350
    
348 351
    return render_metadata(request, updated, status=201)
349 352

  
350 353
@api_method('GET')
......
386 389
    meta, created = VirtualMachineMetadata.objects.get_or_create(meta_key=key, vm=vm)
387 390
    meta.meta_value = metadict[key]
388 391
    meta.save()
392
    vm.save()
389 393
    return render_meta(request, meta, status=201)
390 394

  
391 395
@api_method('DELETE')
......
403 407
    vm = get_vm(server_id, request.user)
404 408
    meta = get_vm_meta(vm, key)
405 409
    meta.delete()
410
    vm.save()
406 411
    return HttpResponse(status=204)

Also available in: Unified diff