[pve-devel] [PATCH storage 1/2] fix #2620: storage API: iSCSI: return active field as integer

Aaron Lauterer a.lauterer at proxmox.com
Mon Mar 2 08:52:05 CET 2020


If active, the return value was a string: "1" and not an integer.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 PVE/Storage/ISCSIPlugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Storage/ISCSIPlugin.pm b/PVE/Storage/ISCSIPlugin.pm
index 131ffa0..bb27c89 100644
--- a/PVE/Storage/ISCSIPlugin.pm
+++ b/PVE/Storage/ISCSIPlugin.pm
@@ -353,7 +353,7 @@ sub status {
 
     $cache->{iscsi_sessions} = iscsi_session_list() if !$cache->{iscsi_sessions};
 
-    my $active = defined($cache->{iscsi_sessions}->{$scfg->{target}});
+    my $active = defined($cache->{iscsi_sessions}->{$scfg->{target}}) + 0;
 
     return (0, 0, 0, $active);
 }
-- 
2.20.1





More information about the pve-devel mailing list