mirror of
https://github.com/democratic-csi/democratic-csi.git
synced 2026-10-18 10:07:18 +02:00
minor fixes
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
+12
-3
@@ -183,10 +183,19 @@ class ISCSI {
|
||||
let parsedPortalHostIP = "";
|
||||
if (parsedPortal.host) {
|
||||
// if host is not an ip address
|
||||
if (net.isIP(parsedPortal.host) == 0) {
|
||||
let parsedPortalHost = parsedPortal.host
|
||||
.replaceAll("[", "")
|
||||
.replaceAll("]", "");
|
||||
if (net.isIP(parsedPortalHost) == 0) {
|
||||
// ipv6 response is without []
|
||||
parsedPortalHostIP =
|
||||
(await hostname_lookup(parsedPortal.host)) || "";
|
||||
try {
|
||||
parsedPortalHostIP =
|
||||
(await hostname_lookup(parsedPortal.host)) || "";
|
||||
} catch (err) {
|
||||
console.log(
|
||||
`failed to lookup hostname: host - ${parsedPortal.host}, error - ${err}`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user