Skip to content

Commit

Permalink
Fix test regression in snapshot task deletion
Browse files Browse the repository at this point in the history
Adding an audit callback function with dataset name introduced a
new failure condition for case where snapshot task matching the
id does not exist.
  • Loading branch information
anodos325 committed Aug 8, 2024
1 parent 28cd3bd commit 344874f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middlewared/middlewared/plugins/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ async def do_delete(self, audit_callback, id_, options):
}
"""

dataset = (await self.get_instance(id_))['dataset']
audit_callback(dataset)
if (task := await self.query([['id','=', id_]])):
audit_callback(task[0]['dataset'])

for replication_task in await self.middleware.call('replication.query', [
['direction', '=', 'PUSH'],
Expand Down

0 comments on commit 344874f

Please sign in to comment.