From b27c10f1d4b8cb58352774ec74a275144b461623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Mon, 11 Nov 2019 17:22:24 +0100 Subject: [PATCH] Add handling for backup in progress Shows a better error message when a given backup is already running. fixes QubesOS/qubes-issues#5432 requires https://github.com/QubesOS/qubes-core-admin/pull/292 --- qubesmanager/backup.py | 3 +++ test-packages/qubesadmin/exc.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/qubesmanager/backup.py b/qubesmanager/backup.py index f73590e..3c09fb1 100644 --- a/qubesmanager/backup.py +++ b/qubesmanager/backup.py @@ -52,6 +52,9 @@ class BackupThread(QtCore.QThread): self.vm.app.qubesd_call( 'dom0', 'admin.backup.Execute', backup_utils.get_profile_name(True)) + except exc.BackupAlreadyRunningError: + msg.append("This backup is already in progress! Cancel it " + "or wait until it finishes.") except Exception as ex: # pylint: disable=broad-except msg.append(str(ex)) diff --git a/test-packages/qubesadmin/exc.py b/test-packages/qubesadmin/exc.py index 8025cb2..4eb7acb 100644 --- a/test-packages/qubesadmin/exc.py +++ b/test-packages/qubesadmin/exc.py @@ -16,3 +16,7 @@ class QubesDaemonNoResponseError(BaseException): class BackupCancelledError(BaseException): pass + + +class BackupAlreadyRunningError(BaseException): + pass