Allow include=None to be passed to admin.backup.Info

This is forwarded to qubes.backup.Backup(), which uses None to choose
VMs according to their include_in_backups property.

('git show -w' recommended)
This commit is contained in:
Rusty Bird 2018-02-22 20:50:23 +00:00
parent dbaf60ca24
commit 59abdeb30e
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -1293,6 +1293,7 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
dest_vm = profile_data['destination_vm']
dest_path = profile_data['destination_path']
include_vms = profile_data['include']
if include_vms is not None:
# convert old keywords to new keywords
include_vms = [vm.replace('$', '@') for vm in include_vms]
exclude_vms = profile_data.get('exclude', [])
@ -1339,6 +1340,9 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
'specify passphrase_text or passphrase_vm')
# handle include
if include_vms is None:
vms_to_backup = None
else:
vms_to_backup = set(vm for vm in self.app.domains
if any(qubes.utils.match_vm_name_with_special(vm, name)
for name in include_vms))