diff options
| author | Thomas Lamprecht <t.lamprecht@proxmox.com> | 2023-11-22 14:08:00 +0100 |
|---|---|---|
| committer | Thomas Lamprecht <t.lamprecht@proxmox.com> | 2023-11-22 14:08:00 +0100 |
| commit | 5469161c135c2179ac2ce26a3ef212016b7f581e (patch) | |
| tree | e86ff8b3e35b72832fbc3ac838425eb1758a159b /src/PVE/Network/SDN/Subnets.pm | |
| parent | 5aea20cd5b22edf1128861a4f326bc4ac7f46145 (diff) | |
subnets: avoid nested post-if in eval
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Diffstat (limited to 'src/PVE/Network/SDN/Subnets.pm')
| -rw-r--r-- | src/PVE/Network/SDN/Subnets.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/PVE/Network/SDN/Subnets.pm b/src/PVE/Network/SDN/Subnets.pm index 05d2de2..b1885c5 100644 --- a/src/PVE/Network/SDN/Subnets.pm +++ b/src/PVE/Network/SDN/Subnets.pm @@ -399,8 +399,10 @@ sub del_ip { my $plugin = PVE::Network::SDN::Ipams::Plugin->lookup($plugin_config->{type}); $plugin->del_ip($plugin_config, $subnetid, $subnet, $ip); - eval { PVE::Network::SDN::Ipams::del_cache_mac_ip($mac, $ip) if $mac; }; - warn $@ if $@; + if ($mac) { + eval { PVE::Network::SDN::Ipams::del_cache_mac_ip($mac, $ip) }; + warn $@ if $@; + } } eval { |
