api/admin: gracefuly report cancelled backup operation

QubesOS/qubes-issues#2931
This commit is contained in:
Marek Marczykowski-Górecki 2017-07-21 03:10:26 +02:00
parent 088c838ac3
commit 82918ee704
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1209,6 +1209,8 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
self.app.api_admin_running_backups[self.arg] = backup_task
try:
yield from backup_task
except asyncio.CancelledError:
raise qubes.exc.QubesException('Backup cancelled')
finally:
del self.app.api_admin_running_backups[self.arg]