Revision 9c21a2e2

b/snf-cyclades-app/synnefo/logic/backend.py
81 81
        # Set the deleted flag explicitly, cater for admin-initiated removals
82 82
        if opcode == 'OP_INSTANCE_REMOVE':
83 83
            vm.deleted = True
84
            vm.nics.all().delete()
84 85

  
85 86
    # Special case: if OP_INSTANCE_CREATE fails --> ERROR
86 87
    if status in ('canceled', 'error') and opcode == 'OP_INSTANCE_CREATE':
......
93 94
    if (status == 'error' and opcode == 'OP_INSTANCE_REMOVE' and
94 95
        vm.operstate == 'ERROR'):
95 96
        vm.deleted = True
97
        vm.nics.all().delete()
96 98

  
97 99
    # Any other notification of failure leaves the operating state unchanged
98 100

  
......
279 281
def delete_instance(vm):
280 282
    start_action(vm, 'DESTROY')
281 283
    rapi.DeleteInstance(vm.backend_id, dry_run=settings.TEST)
282
    vm.nics.all().delete()
283 284

  
284 285

  
285 286
def reboot_instance(vm, reboot_type):

Also available in: Unified diff