@@ -105,9 +105,9 @@ def translate(state_name: str):
105105 elif state_name .lower () == SliceState .Dead .name .lower ():
106106 return SliceState .Dead
107107 elif state_name .lower () == SliceState .AllocatedOK .name .lower ():
108- return SliceState .Closing
108+ return SliceState .AllocatedOK
109109 elif state_name .lower () == SliceState .AllocatedError .name .lower ():
110- return SliceState .Dead
110+ return SliceState .AllocatedError
111111 else :
112112 return SliceState .All
113113
@@ -296,26 +296,28 @@ def transition_slice(self, *, operation: SliceOperation, reservations: Reservati
296296
297297 if self .state in [SliceState .Nascent , SliceState .Configuring ]:
298298 if not bins .has_state_other_than (ReservationStates .Active , ReservationStates .Closed ,
299- ReservationStates .CloseFail ):
299+ ReservationStates .CloseWait , ReservationStates . CloseFail ):
300300 if not has_error :
301301 self .state = SliceState .StableOK
302302 else :
303303 self .state = SliceState .StableError
304304
305305 if (not bins .has_state_other_than (ReservationStates .Active , ReservationStates .Failed ,
306- ReservationStates .Closed , ReservationStates .CloseFail )) and \
306+ ReservationStates .Closed , ReservationStates .CloseWait ,
307+ ReservationStates .CloseFail )) and \
307308 bins .has_state (s = ReservationStates .Failed ):
308309 self .state = SliceState .StableError
309310
310311 if not bins .has_state_other_than (ReservationStates .Ticketed , ReservationStates .Closed ,
311- ReservationStates .CloseFail ):
312+ ReservationStates .CloseWait , ReservationStates . CloseFail ):
312313 if not has_error :
313314 self .state = SliceState .AllocatedOK
314315 else :
315316 self .state = SliceState .AllocatedError
316317
317318 if (not bins .has_state_other_than (ReservationStates .Ticketed , ReservationStates .Failed ,
318- ReservationStates .Closed , ReservationStates .CloseFail )) and \
319+ ReservationStates .Closed , ReservationStates .CloseWait ,
320+ ReservationStates .CloseFail )) and \
319321 bins .has_state (s = ReservationStates .Failed ):
320322 self .state = SliceState .AllocatedError
321323
@@ -325,14 +327,15 @@ def transition_slice(self, *, operation: SliceOperation, reservations: Reservati
325327
326328 elif self .state in [SliceState .AllocatedOK , SliceState .AllocatedError ]:
327329 if not bins .has_state_other_than (ReservationStates .Active , ReservationStates .Closed ,
328- ReservationStates .CloseFail ):
330+ ReservationStates .CloseWait , ReservationStates . CloseFail ):
329331 if not has_error :
330332 self .state = SliceState .StableOK
331333 else :
332334 self .state = SliceState .StableError
333335
334336 if (not bins .has_state_other_than (ReservationStates .Active , ReservationStates .Failed ,
335- ReservationStates .Closed , ReservationStates .CloseFail )) and \
337+ ReservationStates .Closed , ReservationStates .CloseWait ,
338+ ReservationStates .CloseFail )) and \
336339 bins .has_state (s = ReservationStates .Failed ):
337340 self .state = SliceState .StableError
338341
@@ -342,26 +345,28 @@ def transition_slice(self, *, operation: SliceOperation, reservations: Reservati
342345
343346 elif self .state == SliceState .Modifying :
344347 if not bins .has_state_other_than (ReservationStates .Active , ReservationStates .Closed ,
345- ReservationStates .CloseFail ):
348+ ReservationStates .CloseWait , ReservationStates . CloseFail ):
346349 if has_error :
347350 self .state = SliceState .ModifyError
348351 else :
349352 self .state = SliceState .ModifyOK
350353
351354 if (not bins .has_state_other_than (ReservationStates .Active , ReservationStates .Failed ,
352- ReservationStates .Closed , ReservationStates .CloseFail )) and \
355+ ReservationStates .Closed , ReservationStates .CloseWait ,
356+ ReservationStates .CloseFail )) and \
353357 bins .has_state (s = ReservationStates .Failed ):
354358 self .state = SliceState .ModifyError
355359
356360 if not bins .has_state_other_than (ReservationStates .Ticketed , ReservationStates .Closed ,
357- ReservationStates .CloseFail ):
361+ ReservationStates .CloseWait , ReservationStates . CloseFail ):
358362 if has_error :
359363 self .state = SliceState .ModifyError
360364 else :
361365 self .state = SliceState .ModifyOK
362366
363367 if (not bins .has_state_other_than (ReservationStates .Ticketed , ReservationStates .Failed ,
364- ReservationStates .Closed , ReservationStates .CloseFail )) and \
368+ ReservationStates .Closed , ReservationStates .CloseWait ,
369+ ReservationStates .CloseFail )) and \
365370 bins .has_state (s = ReservationStates .Failed ):
366371 self .state = SliceState .ModifyError
367372
0 commit comments