Bug 4324: neutron port for router must allow empty string as tenant id 91/27091/2
authorFlavio Fernandes <ffernand@redhat.com>
Thu, 17 Sep 2015 04:55:02 +0000 (00:55 -0400)
committerFlavio Fernandes <ffernand@redhat.com>
Thu, 17 Sep 2015 14:31:31 +0000 (10:31 -0400)
Patch set 2: complement toMd() by adding corresponding check on from Md()

Change-Id: Ifae54f92f85cc73e744a3b348d03fd7ddd290311
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronPortInterface.java

index c2fd1ee7ce55c351d49868fd8075102dbf7e5f37..3365f84afdb5255780f46e267a475ad8f87a467c 100644 (file)
@@ -206,7 +206,9 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
             result.setSecurityGroups(groups);
         }
         result.setStatus(port.getStatus());
-        result.setTenantID(String.valueOf(port.getTenantId().getValue()).replace("-",""));
+        if (port.getTenantId() != null) {
+            result.setTenantID(String.valueOf(port.getTenantId().getValue()).replace("-", ""));
+        }
         result.setPortUUID(String.valueOf(port.getUuid().getValue()));
         addExtensions(port, result);
         return result;
@@ -299,7 +301,7 @@ public class NeutronPortInterface extends AbstractNeutronInterface<Port, Neutron
         if (neutronPort.getStatus() != null) {
             portBuilder.setStatus(neutronPort.getStatus());
         }
-        if (neutronPort.getTenantID() != null) {
+        if (neutronPort.getTenantID() != null && neutronPort.getTenantID() != "") {
             portBuilder.setTenantId(toUuid(neutronPort.getTenantID()));
         }
         if (neutronPort.getPortUUID() != null) {