Merge "Check return of _load_state" into feature/v2

This commit is contained in:
Jenkins 2017-02-06 23:41:50 +00:00 committed by Gerrit Code Review
commit 0f224d3ae6

View File

@ -188,6 +188,8 @@ class BlockDevice(object):
"""Cleanup all remaining relicts - in good case""" """Cleanup all remaining relicts - in good case"""
dg, reverse_order, state = self._load_state() dg, reverse_order, state = self._load_state()
if dg is None:
return 0
for node in reverse_order: for node in reverse_order:
node.cleanup(state) node.cleanup(state)
@ -200,6 +202,8 @@ class BlockDevice(object):
"""Cleanup all remaining relicts - in case of an error""" """Cleanup all remaining relicts - in case of an error"""
dg, reverse_order, state = self._load_state() dg, reverse_order, state = self._load_state()
if dg is None:
return 0
for node in reverse_order: for node in reverse_order:
node.delete(state) node.delete(state)