diff options
| author | Wolfgang Bumiller <w.bumiller@proxmox.com> | 2023-11-22 11:56:12 +0100 |
|---|---|---|
| committer | Wolfgang Bumiller <w.bumiller@proxmox.com> | 2023-11-22 12:29:07 +0100 |
| commit | 1f5481ad6b03d1ca00f46a6388b2da4b91479570 (patch) | |
| tree | d7cd667e4c6e21d4ab4837e8637566241e54e0cf | |
| parent | 99264c81d66103d48035fca383fa09fd24dd9850 (diff) | |
api: handle delete parameter when updating dns entries
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
| -rw-r--r-- | src/PVE/API2/Network/SDN/Dns.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/PVE/API2/Network/SDN/Dns.pm b/src/PVE/API2/Network/SDN/Dns.pm index 3d08552..826d111 100644 --- a/src/PVE/API2/Network/SDN/Dns.pm +++ b/src/PVE/API2/Network/SDN/Dns.pm @@ -173,6 +173,7 @@ __PACKAGE__->register_method ({ my $id = extract_param($param, 'dns'); my $digest = extract_param($param, 'digest'); + my $delete = extract_param($param, 'delete'); PVE::Network::SDN::lock_sdn_config( sub { @@ -186,6 +187,12 @@ __PACKAGE__->register_method ({ my $plugin = PVE::Network::SDN::Dns::Plugin->lookup($scfg->{type}); my $opts = $plugin->check_config($id, $param, 0, 1); + if ($delete) { + $delete = [ PVE::Tools::split_list($delete) ]; + my $options = $plugin->private()->{options}->{$scfg->{type}}; + PVE::SectionConfig::delete_from_config($scfg, $options, $opts, $delete); + } + foreach my $k (%$opts) { $scfg->{$k} = $opts->{$k}; } |
