Browse Source

HPCC-22120 Ensure resolved IP for SparkThor setting

When '.' is used as the IP setting, WsTopology should return the
resolved IP for the setting.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 5 years ago
parent
commit
16a988528c
1 changed files with 10 additions and 1 deletions
  1. 10 1
      esp/smc/SMCLib/TpWrapper.cpp

+ 10 - 1
esp/smc/SMCLib/TpWrapper.cpp

@@ -1818,7 +1818,16 @@ void CTpWrapper::appendTpMachine(double clientVersion, IConstEnvironment* constE
 
     Owned<IEspTpMachine> machine = createTpMachine();
     machine->setName(name.str());
-    machine->setNetaddress(networkAddress.str());
+
+    if (networkAddress.length() > 0)
+    {
+        IpAddress ipAddr;
+        ipAddr.ipset(networkAddress.str());
+
+        StringBuffer networkAddressStr;
+        ipAddr.getIpText(networkAddressStr);
+        machine->setNetaddress(networkAddressStr);
+    }
     machine->setPort(instanceInfo.getPort());
     machine->setOS(machineInfo->getOS());
     machine->setDirectory(directory.str());