summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Hanreich <s.hanreich@proxmox.com>2025-03-10 09:50:58 +0100
committerThomas Lamprecht <t.lamprecht@proxmox.com>2025-04-07 17:43:36 +0200
commitcea37c09da99adcaef1d7cf7dbbd8aa82796030d (patch)
tree0ef3e37802f4221fbe8f1a1e45aef6666addfd07 /src
parent449e08a8fb15d2ba21936250af0c228abec8d22c (diff)
ipam: netbox: simplify helpers
The helpers had lots of unnecessary intermediate assignments, which we can just simplify. Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com> Tested-by: Hannes Duerr <h.duerr@proxmox.com> Link: https://lore.proxmox.com/20250310085103.30549-3-s.hanreich@proxmox.com Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Diffstat (limited to 'src')
-rw-r--r--src/PVE/Network/SDN/Ipams/NetboxPlugin.pm13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm b/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm
index f0b70fd..6595cbc 100644
--- a/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm
+++ b/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm
@@ -288,8 +288,7 @@ sub get_prefix_id {
}
my $data = @{$result->{results}}[0];
- my $internalid = $data->{id};
- return $internalid;
+ return $data->{id};
}
sub get_iprange_id {
@@ -308,8 +307,7 @@ sub get_iprange_id {
}
my $data = @{$result->{results}}[0];
- my $internalid = $data->{id};
- return $internalid;
+ return $data->{id};
}
sub get_ip_id {
@@ -322,8 +320,7 @@ sub get_ip_id {
}
my $data = @{$result->{results}}[0];
- my $ip_id = $data->{id};
- return $ip_id;
+ return $data->{id};
}
sub is_ip_gateway {
@@ -336,9 +333,7 @@ sub is_ip_gateway {
}
my $data = @{$result->{data}}[0];
- my $description = $data->{description};
- my $is_gateway = 1 if $description eq 'gateway';
- return $is_gateway;
+ return $data->{description} eq 'gateway';
}
sub is_prefix_empty {