From 74c53636b8af4f7b2f3a858126c7c2a33c68a020 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Wed, 1 Aug 2018 18:15:20 +0100 Subject: [PATCH] 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 --- blazar/status.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/blazar/status.py b/blazar/status.py index 0c25291f..032fec05 100644 --- a/blazar/status.py +++ b/blazar/status.py @@ -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) } }