implementing routing for VPP
[groupbasedpolicy.git] / neutron-vpp-mapper / src / main / java / org / opendaylight / groupbasedpolicy / neutron / vpp / mapper / processors / PortHandler.java
index 11d7df4f8f67b7e462fb70248c68f768e5ebe848..3ca0883ea42a8b8699cacf92a545359e07c2d1b4 100644 (file)
@@ -365,10 +365,17 @@ public class PortHandler implements TransactionChainListener {
         if (Strings.isNullOrEmpty(port.getDeviceId())) {\r
             return Optional.absent();\r
         }\r
+        RouterKey routerKey = null;\r
+        try {\r
+            routerKey = new RouterKey(new Uuid(port.getDeviceId()));\r
+        } catch (IllegalArgumentException e) {\r
+            // port.getDeviceId() may not match Uuid.PATTERN_CONSTANTS\r
+            return Optional.absent();\r
+        }\r
         ReadOnlyTransaction rTx = transactionChain.newReadOnlyTransaction();\r
         InstanceIdentifier<Router> routerIid = InstanceIdentifier.builder(Neutron.class)\r
             .child(Routers.class)\r
-            .child(Router.class, new RouterKey(new Uuid(port.getDeviceId())))\r
+            .child(Router.class, routerKey)\r
             .build();\r
         Optional<Router> optRouter = DataStoreHelper.readFromDs(LogicalDatastoreType.CONFIGURATION, routerIid, rTx);\r
         rTx.close();\r