sangho
Committed by Ray Milkey

[Falcon] SONA : Supports port-create without fixed IPs

Change-Id: I3a37540480912849f03e8880cc8c9b387c6bc613
...@@ -161,7 +161,9 @@ public class OpenstackSwitchingManager implements OpenstackSwitchingService { ...@@ -161,7 +161,9 @@ public class OpenstackSwitchingManager implements OpenstackSwitchingService {
161 161
162 @Override 162 @Override
163 public void createPorts(OpenstackPort openstackPort) { 163 public void createPorts(OpenstackPort openstackPort) {
164 - registerDhcpInfo(openstackPort); 164 + if (!openstackPort.fixedIps().isEmpty()) {
165 + registerDhcpInfo(openstackPort);
166 + }
165 } 167 }
166 168
167 @Override 169 @Override
......
...@@ -73,7 +73,7 @@ public class OpenstackPortCodec extends JsonCodec<OpenstackPort> { ...@@ -73,7 +73,7 @@ public class OpenstackPortCodec extends JsonCodec<OpenstackPort> {
73 for (JsonNode fixedIpInfo: fixedIpList) { 73 for (JsonNode fixedIpInfo: fixedIpList) {
74 String subnetId = fixedIpInfo.path(SUBNET_ID).asText(); 74 String subnetId = fixedIpInfo.path(SUBNET_ID).asText();
75 String ipAddressStr = fixedIpInfo.path(IP_ADDRESS).asText(); 75 String ipAddressStr = fixedIpInfo.path(IP_ADDRESS).asText();
76 - if (ipAddressStr != null) { 76 + if (!fixedIpInfo.path(IP_ADDRESS).isMissingNode() && ipAddressStr != null) {
77 Ip4Address ipAddress = Ip4Address.valueOf(ipAddressStr); 77 Ip4Address ipAddress = Ip4Address.valueOf(ipAddressStr);
78 fixedIpMap.put(subnetId, ipAddress); 78 fixedIpMap.put(subnetId, ipAddress);
79 } 79 }
......