Skip to content

Commit 287bb21

Browse files
committed
resource-api: Do not delete all snapshots if only deleted on a node
1 parent ae95183 commit 287bb21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

linstor/resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ def delete(self, node_name=None, snapshots=True):
711711
with linstor.MultiLinstor(self.client.uri_list, self.client.timeout, self.client.keep_alive) as lin:
712712
self._lin = lin
713713

714-
if snapshots:
714+
if snapshots and node_name is None: # only remove snapshots if resource definition will be deleted
715715
snapshot_list = lin.snapshot_dfn_list()[0] # type: linstor.responses.SnapshotResponse
716716
for snap in [x for x in snapshot_list.snapshots if x.rsc_name.lower() == self._linstor_name.lower()]:
717717
lin.snapshot_delete(rsc_name=self._linstor_name, snapshot_name=snap.snapshot_name)

0 commit comments

Comments
 (0)