Revision 685b219e logic/backend.py

b/logic/backend.py
27 27
    # Notifications of success change the operating state
28 28
    if status == 'success':
29 29
        utils.update_state(vm, VirtualMachine.OPER_STATE_FROM_OPCODE[opcode])
30
    # Special cases OP_INSTANCE_CREATE fails --> ERROR
30
        # Set the deleted flag explicitly, to cater for admin-initiated removals
31
        if opcode == 'OP_INSTANCE_REMOVE':
32
            vm.deleted = True
33

  
34
    # Special case: if OP_INSTANCE_CREATE fails --> ERROR
31 35
    if status in ('canceled', 'error') and opcode == 'OP_INSTANCE_CREATE':
32 36
        utils.update_state(vm, 'ERROR')
33 37
    # Any other notification of failure leaves the operating state unchanged

Also available in: Unified diff