[pve-devel] [PATCH pve-network 07/15] ipam: phpipam: rename get_internal to get_prefix_id (like netbox)

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


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN/Ipams/PhpIpamPlugin.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm b/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm
index 7147916..235d553 100644
--- a/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm
+++ b/PVE/Network/SDN/Ipams/PhpIpamPlugin.pm
@@ -51,7 +51,7 @@ sub add_subnet {
     my $headers = ['Content-Type' => 'application/json; charset=UTF-8', 'Token' => $token];
 
     #search subnet
-    my $internalid = get_internalid($url, $cidr, $headers);
+    my $internalid = get_prefix_id($url, $cidr, $headers);
 
     #create subnet
     if (!$internalid) {
@@ -80,7 +80,7 @@ sub del_subnet {
     my $section = $plugin_config->{section};
     my $headers = ['Content-Type' => 'application/json; charset=UTF-8', 'Token' => $token];
 
-    my $internalid = get_internalid($url, $cidr, $headers);
+    my $internalid = get_prefix_id($url, $cidr, $headers);
     return if !$internalid;
 
     return; #fixme: check that prefix is empty exluding gateway, before delete
@@ -103,7 +103,7 @@ sub add_ip {
     my $section = $plugin_config->{section};
     my $headers = ['Content-Type' => 'application/json; charset=UTF-8', 'Token' => $token];
 
-    my $internalid = get_internalid($url, $cidr, $headers);
+    my $internalid = get_prefix_id($url, $cidr, $headers);
 
     my $params = { ip => $ip,
 		   subnetId => $internalid,
@@ -160,7 +160,7 @@ sub add_next_freeip {
     my $section = $plugin_config->{section};
     my $headers = ['Content-Type' => 'application/json; charset=UTF-8', 'Token' => $token];
 
-    my $internalid = get_internalid($url, $cidr, $headers);
+    my $internalid = get_prefix_id($url, $cidr, $headers);
 
     my $params = { hostname => $hostname,
 		   description => $description,
@@ -226,7 +226,7 @@ sub on_update_hook {
 
 #helpers
 
-sub get_internalid {
+sub get_prefix_id {
     my ($url, $cidr, $headers) = @_;
 
     my $result = PVE::Network::SDN::api_request("GET", "$url/subnets/cidr/$cidr", $headers);
-- 
2.20.1





More information about the pve-devel mailing list