Check return of _load_state
In error scenarios there might be no loadable state available. This patch adds some robustness handling this scenarios by checking the result and possible bailing out. Change-Id: I02e2731b14bec22c22db08d60d8d15db1911a84e Signed-off-by: Andreas Florath <andreas@florath.net>
This commit is contained in:
parent
3f8800832a
commit
df1f583903
@ -179,6 +179,8 @@ local_loop:
|
||||
"""Cleanup all remaining relicts - in good case"""
|
||||
|
||||
dg, reverse_order, state = self._load_state()
|
||||
if dg is None:
|
||||
return 0
|
||||
for node in reverse_order:
|
||||
node.cleanup(state)
|
||||
|
||||
@ -191,6 +193,8 @@ local_loop:
|
||||
"""Cleanup all remaining relicts - in case of an error"""
|
||||
|
||||
dg, reverse_order, state = self._load_state()
|
||||
if dg is None:
|
||||
return 0
|
||||
for node in reverse_order:
|
||||
node.delete(state)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user