Bug 4775 - handle cases when tenant-id is an empty string
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronObject.java
index 17e8f1656487472516063c575ece8e3af5c5f6c2..7ccbe695072f91eac5b6e3e64bee349b740678ce 100644 (file)
@@ -32,6 +32,11 @@ public class NeutronObject extends Neutron_ID implements Serializable, INeutronO
 
     @Override
     public String getTenantID() {
+        if (tenantID != null && tenantID.isEmpty()) {
+            // Bug 4775 - Treat empty string tenantId as null, so no attempt is made
+            //            to turn it into a uuid.
+            return null;
+        }
         return tenantID;
     }
 
@@ -49,4 +54,8 @@ public class NeutronObject extends Neutron_ID implements Serializable, INeutronO
     public String toString() {
         return "NeutronObject [id=" + uuid + ", tenantID=" + tenantID + "]";
     }
+
+    @Override
+    public void initDefaults() {
+    }
 }