[pve-devel] [PATCH pve-network 10/15] dns: add noerr param

Alexandre Derumier aderumier at odiso.com
Tue Jan 5 10:35:31 CET 2021


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN/Dns/Plugin.pm         | 10 +++++-----
 PVE/Network/SDN/Dns/PowerdnsPlugin.pm | 22 +++++++++++-----------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/PVE/Network/SDN/Dns/Plugin.pm b/PVE/Network/SDN/Dns/Plugin.pm
index 199c170..07d0be1 100644
--- a/PVE/Network/SDN/Dns/Plugin.pm
+++ b/PVE/Network/SDN/Dns/Plugin.pm
@@ -67,31 +67,31 @@ sub parse_section_header {
 
 
 sub add_a_record {
-    my ($class, $plugin_config, $zone, $hostname, $ip) = @_;
+    my ($class, $plugin_config, $zone, $hostname, $ip, $noerr) = @_;
 
     die "please implement inside plugin";
 }
 
 sub add_ptr_record {
-    my ($class, $plugin_config, $zone, $hostname, $ip) = @_;
+    my ($class, $plugin_config, $zone, $hostname, $ip, $noerr) = @_;
 
     die "please implement inside plugin";
 }
 
 sub del_ptr_record {
-    my ($class, $plugin_config, $zone, $ip) = @_;
+    my ($class, $plugin_config, $zone, $ip, $noerr) = @_;
 
     die "please implement inside plugin";
 }
 
 sub del_a_record {
-    my ($class, $plugin_config, $zone, $hostname, $ip) = @_;
+    my ($class, $plugin_config, $zone, $hostname, $ip, $noerr) = @_;
 
     die "please implement inside plugin";
 }
 
 sub verify_zone {
-    my ($class, $plugin_config, $zone) = @_;
+    my ($class, $plugin_config, $zone, $noerr) = @_;
 
     die "please implement inside plugin";
 }
diff --git a/PVE/Network/SDN/Dns/PowerdnsPlugin.pm b/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
index d93fb06..339ac28 100644
--- a/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
+++ b/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
@@ -42,7 +42,7 @@ sub options {
 # Plugin implementation
 
 sub add_a_record {
-    my ($class, $plugin_config, $zone, $hostname, $ip) = @_;
+    my ($class, $plugin_config, $zone, $hostname, $ip, $noerr) = @_;
 
     my $url = $plugin_config->{url};
     my $key = $plugin_config->{key};
@@ -88,12 +88,12 @@ sub add_a_record {
     };
 
     if ($@) {
-	die "error add $fqdn to zone $zone: $@";
+	die "error add $fqdn to zone $zone: $@" if !$noerr;
     }
 }
 
 sub add_ptr_record {
-    my ($class, $plugin_config, $zone, $hostname, $ip) = @_;
+    my ($class, $plugin_config, $zone, $hostname, $ip, $noerr) = @_;
 
     my $url = $plugin_config->{url};
     my $key = $plugin_config->{key};
@@ -125,12 +125,12 @@ sub add_ptr_record {
     };
 
     if ($@) {
-	die "error add $reverseip to zone $zone: $@";
+	die "error add $reverseip to zone $zone: $@" if !$noerr;
     }
 }
 
 sub del_a_record {
-    my ($class, $plugin_config, $zone, $hostname, $ip) = @_;
+    my ($class, $plugin_config, $zone, $hostname, $ip, $noerr) = @_;
 
     my $url = $plugin_config->{url};
     my $key = $plugin_config->{key};
@@ -151,7 +151,7 @@ sub del_a_record {
 	push @$final_records, $record;
     }
     return if !$foundrecord;
- 
+
     my $rrset = {};
    
     if (scalar (@{$final_records}) > 0) {
@@ -177,12 +177,12 @@ sub del_a_record {
     };
 
     if ($@) {
-	die "error delete $fqdn from zone $zone: $@";
+	die "error delete $fqdn from zone $zone: $@" if !$noerr;
     }
 }
 
 sub del_ptr_record {
-    my ($class, $plugin_config, $zone, $ip) = @_;
+    my ($class, $plugin_config, $zone, $ip, $noerr) = @_;
 
     my $url = $plugin_config->{url};
     my $key = $plugin_config->{key};
@@ -204,12 +204,12 @@ sub del_ptr_record {
     };
 
     if ($@) {
-	die "error delete $reverseip from zone $zone: $@";
+	die "error delete $reverseip from zone $zone: $@" if !$noerr;
     }
 }
 
 sub verify_zone {
-    my ($class, $plugin_config, $zone) = @_;
+    my ($class, $plugin_config, $zone, $noerr) = @_;
 
     #verify that api is working              
 
@@ -222,7 +222,7 @@ sub verify_zone {
     };
 
     if ($@) {
-        die "can't read zone $zone: $@";
+        die "can't read zone $zone: $@" if !$noerr;
     }
 }
 
-- 
2.20.1




More information about the pve-devel mailing list