[pve-devel] [PATCH manager] Delete "exclude" when switching a backup job to pool

Tim Marx t.marx at proxmox.com
Tue Aug 6 14:22:30 CEST 2019


Thanks for spotting this one.
IMHO this would be better fixed in the API, unless we really want to allow pool backups which exclude vms:
diff --git a/PVE/API2/Backup.pm b/PVE/API2/Backup.pm
index bf9a3330..6c2e16c3 100644
--- a/PVE/API2/Backup.pm
+++ b/PVE/API2/Backup.pm
@@ -476,6 +476,7 @@ __PACKAGE__->register_method({
                    } elsif ($job->{pool}) {
                        delete $job->{vmid};
                        delete $job->{all};
+                       delete $job->{exclude};
                    }
> Stefan Reiter <s.reiter at proxmox.com> hat am 6. August 2019 11:17 geschrieben:
> 
>  
> Previously, if you selected a job in "exclude" mode (in DC GUI) with some VMIDs
> selected and then switched that backup job to "pool", the backup job would
> retain the "exclude" section and thus not back up all VMs.
> 
> The backend technically supports this, but the GUI would then misrepresent this,
> showing that all VMs will be backed up (when in reality some will be excluded)
> or straight up break and show "exclude" mode again, with the backend still being
> on "pool".
> 
> Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
> ---
>  www/manager6/dc/Backup.js | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
> index 6810d92f..79e9cace 100644
> --- a/www/manager6/dc/Backup.js
> +++ b/www/manager6/dc/Backup.js
> @@ -251,6 +251,8 @@ Ext.define('PVE.dc.BackupEdit', {
>  		    values.exclude = values.vmid;
>  		    delete values.vmid;
>  		} else if (selMode === 'pool') {
> +		    delete values.exclude;
> +		    Proxmox.Utils.assemble_field_data(values, { 'delete': 'exclude' });
>  		    delete values.vmid;
>  		}
>  
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list