Revision db3037f1 snf-cyclades-app/synnefo/logic/backend.py
b/snf-cyclades-app/synnefo/logic/backend.py | ||
---|---|---|
1 |
# Copyright 2011 GRNET S.A. All rights reserved. |
|
1 |
# Copyright 2011-2013 GRNET S.A. All rights reserved.
|
|
2 | 2 |
# |
3 | 3 |
# Redistribution and use in source and binary forms, with or |
4 | 4 |
# without modification, are permitted provided that the following |
... | ... | |
93 | 93 |
if status == "success" or (status == "error" and |
94 | 94 |
not vm_exists_in_backend(vm)): |
95 | 95 |
_process_net_status(vm, etime, nics=[]) |
96 |
already_deleted = vm.deleted |
|
96 | 97 |
vm.deleted = True |
97 | 98 |
vm.operstate = state_for_success |
98 | 99 |
vm.backendtime = etime |
99 | 100 |
# Issue and accept commission to Quotaholder |
100 |
quotas.issue_and_accept_commission(vm, delete=True) |
|
101 |
if not already_deleted: |
|
102 |
quotas.issue_and_accept_commission(vm, delete=True) |
|
101 | 103 |
|
102 | 104 |
# Update backendtime only for jobs that have been successfully completed, |
103 | 105 |
# since only these jobs update the state of the VM. Else a "race condition" |
Also available in: Unified diff