iscsi: code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -47,8 +47,7 @@ sub iscsi_session_list {
|
|||||||
if ($line =~ m/^tcp:\s+\[(\S+)\]\s+((?:$IPV4RE|\[$IPV6RE\]):\d+)\,\S+\s+(\S+)\s+\S+?\s*$/) {
|
if ($line =~ m/^tcp:\s+\[(\S+)\]\s+((?:$IPV4RE|\[$IPV6RE\]):\d+)\,\S+\s+(\S+)\s+\S+?\s*$/) {
|
||||||
my ($session_id, $portal, $target) = ($1, $2, $3);
|
my ($session_id, $portal, $target) = ($1, $2, $3);
|
||||||
# there can be several sessions per target (multipath)
|
# there can be several sessions per target (multipath)
|
||||||
my %session = ( session_id => $session_id, portal => $portal );
|
push @{$res->{$target}}, { session_id => $session_id, portal => $portal };
|
||||||
push @{$res->{$target}}, \%session;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -477,10 +476,10 @@ sub volume_has_feature {
|
|||||||
$class->parse_volname($volname);
|
$class->parse_volname($volname);
|
||||||
|
|
||||||
my $key = undef;
|
my $key = undef;
|
||||||
if($snapname){
|
if ($snapname){
|
||||||
$key = 'snap';
|
$key = 'snap';
|
||||||
}else{
|
} else {
|
||||||
$key = $isBase ? 'base' : 'current';
|
$key = $isBase ? 'base' : 'current';
|
||||||
}
|
}
|
||||||
return 1 if $features->{$feature}->{$key};
|
return 1 if $features->{$feature}->{$key};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user