HDDS-908: NPE in TestOzoneRpcClient.
Contributed by Ajay Kumar.
This commit is contained in:
parent
71e0b0d800
commit
5426653819
@ -1438,11 +1438,14 @@ public List<ServiceInfo> getServiceList() throws IOException {
|
||||
.setNodeType(HddsProtos.NodeType.DATANODE)
|
||||
.setHostname(datanode.getHostName());
|
||||
|
||||
dnServiceInfoBuilder.addServicePort(ServicePort.newBuilder()
|
||||
.setType(ServicePort.Type.HTTP)
|
||||
.setValue(DatanodeDetails.getFromProtoBuf(datanode)
|
||||
.getPort(DatanodeDetails.Port.Name.REST).getValue())
|
||||
.build());
|
||||
if(DatanodeDetails.getFromProtoBuf(datanode)
|
||||
.getPort(DatanodeDetails.Port.Name.REST) != null) {
|
||||
dnServiceInfoBuilder.addServicePort(ServicePort.newBuilder()
|
||||
.setType(ServicePort.Type.HTTP)
|
||||
.setValue(DatanodeDetails.getFromProtoBuf(datanode)
|
||||
.getPort(DatanodeDetails.Port.Name.REST).getValue())
|
||||
.build());
|
||||
}
|
||||
|
||||
services.add(dnServiceInfoBuilder.build());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user