diff --git a/qubes/api/admin.py b/qubes/api/admin.py index b42d6479..b8032264 100644 --- a/qubes/api/admin.py +++ b/qubes/api/admin.py @@ -1347,10 +1347,10 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI): if any(qubes.utils.match_vm_name_with_special(vm, name) for name in include_vms)) - # handle exclude - vms_to_backup.difference_update(vm for vm in self.app.domains - if any(qubes.utils.match_vm_name_with_special(vm, name) - for name in exclude_vms)) + # handle exclude + vms_to_exclude = set(vm.name for vm in self.app.domains + if any(qubes.utils.match_vm_name_with_special(vm, name) + for name in exclude_vms)) kwargs = { 'target_vm': dest_vm, @@ -1360,7 +1360,8 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI): } if isinstance(compression, str): kwargs['compression_filter'] = compression - backup = qubes.backup.Backup(self.app, vms_to_backup, **kwargs) + backup = qubes.backup.Backup(self.app, vms_to_backup, vms_to_exclude, + **kwargs) return backup def _backup_progress_callback(self, profile_name, progress): diff --git a/qubes/tests/api_admin.py b/qubes/tests/api_admin.py index dcbe5522..564b4d69 100644 --- a/qubes/tests/api_admin.py +++ b/qubes/tests/api_admin.py @@ -2003,6 +2003,7 @@ class TC_00_VMs(AdminAPITestCase): mock_backup.assert_called_once_with( self.app, {self.vm}, + set(), target_vm=self.vm, target_dir='/home/user', compressed=True, @@ -2038,6 +2039,7 @@ class TC_00_VMs(AdminAPITestCase): mock_backup.assert_called_once_with( self.app, {self.vm}, + set(), target_vm=self.vm, target_dir='/home/user', compressed=True,