Skip to content

Commit 9207abe

Browse files
NambrokWescoeur
authored andcommitted
fix(linstor): check if resource is tiebreaker (#62)
We check if a resource is already a tiebreaker before trying to delete the resource. If it is, we do not delete it. Signed-off-by: Damien Thenot <[email protected]>
1 parent 8434a42 commit 9207abe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/linstorvolumemanager.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,13 @@ def remove_volume_if_diskless(self, volume_uuid):
812812
volume_name = volume_properties.get(self.PROP_VOLUME_NAME)
813813

814814
node_name = socket.gethostname()
815+
816+
for resource in self._get_resource_cache().resources:
817+
if resource.name == volume_name and resource.node_name == node_name:
818+
if linstor.consts.FLAG_TIE_BREAKER in resource.flags:
819+
return
820+
break
821+
815822
result = self._linstor.resource_delete_if_diskless(
816823
node_name=node_name, rsc_name=volume_name
817824
)

0 commit comments

Comments
 (0)