[pve-devel] [PATCH pve-network 15/15] fix coding style NetAddr::IP->new

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


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN/Dns/PowerdnsPlugin.pm | 2 +-
 PVE/Network/SDN/Ipams/PVEPlugin.pm    | 2 +-
 PVE/Network/SDN/Subnets.pm            | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/PVE/Network/SDN/Dns/PowerdnsPlugin.pm b/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
index 339ac28..096d131 100644
--- a/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
+++ b/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
@@ -237,7 +237,7 @@ sub get_reversedns_zone {
     if (Net::IP::ip_is_ipv4($ip)) {
 	my ($ipblock1, $ipblock2, $ipblock3, $ipblock4) = split(/\./, $ip);
 
-        my $ipv4 = new NetAddr::IP($cidr);
+        my $ipv4 = NetAddr::IP->new($cidr);
 	#private addresse #powerdns built-in private zone : serve-rfc1918
 	if($ipv4->is_rfc1918()) {
 	    if ($ipblock1 == 192) {
diff --git a/PVE/Network/SDN/Ipams/PVEPlugin.pm b/PVE/Network/SDN/Ipams/PVEPlugin.pm
index 2527850..7e2fb77 100644
--- a/PVE/Network/SDN/Ipams/PVEPlugin.pm
+++ b/PVE/Network/SDN/Ipams/PVEPlugin.pm
@@ -131,7 +131,7 @@ sub add_next_freeip {
 	    die "cannot find free IP in subnet '$cidr'\n" if defined($dbsubnet->{ips}->{$network});
 	    $freeip = $network;
 	} else {
-	    my $iplist = new NetAddr::IP($cidr);
+	    my $iplist = NetAddr::IP->new($cidr);
 	    my $broadcast = $iplist->broadcast();
 
 	    while(1) {
diff --git a/PVE/Network/SDN/Subnets.pm b/PVE/Network/SDN/Subnets.pm
index 34b3450..0cbf5fd 100644
--- a/PVE/Network/SDN/Subnets.pm
+++ b/PVE/Network/SDN/Subnets.pm
@@ -234,7 +234,7 @@ sub add_ip {
 
     return if !$subnet || !$ip; 
 
-    my $ipaddr = new NetAddr::IP($ip);
+    my $ipaddr = NetAddr::IP->new($ip);
     $ip = $ipaddr->canon();
 
     my $ipamid = $zone->{ipam};
@@ -281,7 +281,7 @@ sub update_ip {
 
     return if !$subnet || !$ip; 
 
-    my $ipaddr = new NetAddr::IP($ip);
+    my $ipaddr = NetAddr::IP->new($ip);
     $ip = $ipaddr->canon();
 
     my $ipamid = $zone->{ipam};
@@ -325,7 +325,7 @@ sub del_ip {
 
     return if !$subnet || !$ip;
 
-    my $ipaddr = new NetAddr::IP($ip);
+    my $ipaddr = NetAddr::IP->new($ip);
     $ip = $ipaddr->canon();
 
     my $ipamid = $zone->{ipam};
-- 
2.20.1




More information about the pve-devel mailing list