Revision 093f9c53 logic/backend.py

b/logic/backend.py
50 50
_reverse_tags = dict((v.split(':')[3], k) for k, v in _firewall_tags.items())
51 51

  
52 52

  
53
@transaction.commit_on_success
53 54
def process_op_status(vm, jobid, opcode, status, logmsg):
54 55
    """Process a job progress notification from the backend
55 56

  
......
77 78
    # Special case: if OP_INSTANCE_CREATE fails --> ERROR
78 79
    if status in ('canceled', 'error') and opcode == 'OP_INSTANCE_CREATE':
79 80
        utils.update_state(vm, 'ERROR')
81

  
82
    # Special case: OP_INSTANCE_REMOVE fails for machines in ERROR,
83
    # when no instance exists at the Ganeti backend.
84
    # See ticket #799 for all the details.
85
    #
86
    if (status == 'error' and opcode == 'OP_INSTANCE_REMOVE' and
87
        vm.operstate == 'ERROR'):
88
        vm.deleted = True
89

  
80 90
    # Any other notification of failure leaves the operating state unchanged
81 91

  
82 92
    vm.save()

Also available in: Unified diff