Merge remote-tracking branch 'qubesos/pr/202'

* qubesos/pr/202:
  api/admin: fix backup exclude
This commit is contained in:
Marek Marczykowski-Górecki 2018-03-20 14:44:20 +01:00
commit b66a2e9a51
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 8 additions and 5 deletions

View File

@ -1348,7 +1348,7 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
for name in include_vms))
# handle exclude
vms_to_backup.difference_update(vm for vm in self.app.domains
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))
@ -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):

View File

@ -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,