From c4f6c2ff7ab84d63aed0788b7aa3630577c882e6 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 27 Oct 2023 13:44:05 +0200 Subject: [PATCH] iscsi: code cleanups Signed-off-by: Thomas Lamprecht --- src/PVE/Storage/ISCSIPlugin.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/PVE/Storage/ISCSIPlugin.pm b/src/PVE/Storage/ISCSIPlugin.pm index 8b6cc87..2bdd9a2 100644 --- a/src/PVE/Storage/ISCSIPlugin.pm +++ b/src/PVE/Storage/ISCSIPlugin.pm @@ -47,8 +47,7 @@ sub iscsi_session_list { if ($line =~ m/^tcp:\s+\[(\S+)\]\s+((?:$IPV4RE|\[$IPV6RE\]):\d+)\,\S+\s+(\S+)\s+\S+?\s*$/) { my ($session_id, $portal, $target) = ($1, $2, $3); # there can be several sessions per target (multipath) - my %session = ( session_id => $session_id, portal => $portal ); - push @{$res->{$target}}, \%session; + push @{$res->{$target}}, { session_id => $session_id, portal => $portal }; } }); }; @@ -477,10 +476,10 @@ sub volume_has_feature { $class->parse_volname($volname); my $key = undef; - if($snapname){ + if ($snapname){ $key = 'snap'; - }else{ - $key = $isBase ? 'base' : 'current'; + } else { + $key = $isBase ? 'base' : 'current'; } return 1 if $features->{$feature}->{$key};