Allow leases to transition to ERROR status when events fail

If a start_lease or end_lease event fails to execute properly, the lease
does not change to ERROR state because there is no valid combination of
statuses registered for it. This patch adds the necessary combination
for both types of events.

Change-Id: I5a697cdaa37c6d2d168f023cc2af87996c49fa5f
Closes-Bug: #1797940
This commit is contained in:
Pierre Riteau 2018-08-01 18:15:20 +01:00
parent 8d2f4a0f0e
commit 74c53636b8
1 changed files with 7 additions and 0 deletions

View File

@ -317,6 +317,13 @@ COMBINATIONS = {
'end_lease': (EventStatus.UNDONE,
EventStatus.DONE,
EventStatus.ERROR)
},
LeaseStatus.ERROR: {
'reservation': ReservationStatus.ERROR,
'start_lease': (EventStatus.DONE,
EventStatus.ERROR),
'end_lease': (EventStatus.UNDONE,
EventStatus.ERROR)
}
}