Fix for changes to neutron-l3.yang 66/33966/1
authorVishal Thapar <vishal.thapar@ericsson.com>
Tue, 2 Feb 2016 18:53:25 +0000 (00:23 +0530)
committerSam Hague <shague@redhat.com>
Wed, 3 Feb 2016 12:19:43 +0000 (12:19 +0000)
Fix for BUG5137 in neutron breaks any code using routes option of
NeutronRouter. This fix is to change type of routes from String to Routes
as per yang changes.

Change-Id: I89866b31003a8b384c45ef9b451c5d189961df60
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
(cherry picked from commit 61b1b633dfcd9fc1080286ef32d5683e41dff5a5)

openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/NeutronRouter.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/crud/impl/NeutronRouterInterface.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/translator/iaware/impl/NeutronRouterChangeListener.java

index a37a188d555d845d8db7d651c253b7ef7626cecf..a29d34fa9065b6b3c53cb4cc2650625456195649 100644 (file)
@@ -18,6 +18,8 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.l3.attributes.Routes;
+
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
@@ -51,7 +53,7 @@ public class NeutronRouter implements Serializable, INeutronObject {
     String gatewayPortId;
 
     @XmlElement (name = "routes")
-    List<String> routes;
+    List<Routes> routes;
 
     /* Holds a map of OpenStackRouterInterfaces by subnet UUID
      * used for internal mapping to DOVE
@@ -135,11 +137,11 @@ public class NeutronRouter implements Serializable, INeutronObject {
         this.gatewayPortId = gatewayPortId;
     }
 
-    public List<String> getRoutes() {
+    public List<Routes> getRoutes() {
         return routes;
     }
 
-    public void setRoutes(List<String> routes) {
+    public void setRoutes(List<Routes> routes) {
         this.routes = routes;
     }
 
index fbaafe20f7e815c83d53592cd22152747378a0ba..9a45692b7f25eda0d5ad78c6412d49738c623bbd 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Network
 import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
 import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronRouterCRUD;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.l3.attributes.Routes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.Routers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.routers.Router;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.routers.RouterBuilder;
@@ -138,8 +139,8 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
         routerBuilder.setAdminStateUp(router.getAdminStateUp());
         routerBuilder.setDistributed(router.getDistributed());
         if (router.getRoutes() != null) {
-            List<String> routes = new ArrayList<>();
-            for (String route : router.getRoutes()) {
+            List<Routes> routes = new ArrayList<>();
+            for (Routes route : router.getRoutes()) {
                 routes.add(route);
             }
             routerBuilder.setRoutes(routes);
@@ -212,8 +213,8 @@ public class NeutronRouterInterface extends  AbstractNeutronInterface<Router, Ne
             result.setGatewayPortId(String.valueOf(router.getGatewayPortId().getValue()));
         }
         if (router.getRoutes() != null) {
-            List<String> routes = new ArrayList<>();
-            for (String route : router.getRoutes()) {
+            List<Routes> routes = new ArrayList<>();
+            for (Routes route : router.getRoutes()) {
                 routes.add(route);
             }
             result.setRoutes(routes);
index b28576ca34a3b8608322dc702f81810913974674..a4f327305f1ecffb5603dccbfac13e375761df65 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interfa
 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_NetworkReference;
 import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
 import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronRouterAware;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.l3.attributes.Routes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.Routers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.routers.Router;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.routers.router.Interfaces;
@@ -125,8 +126,8 @@ public class NeutronRouterChangeListener implements ClusteredDataChangeListener,
             result.setGatewayPortId(String.valueOf(router.getGatewayPortId().getValue()));
         }
         if (router.getRoutes() != null) {
-            List<String> routes = new ArrayList<>();
-            for (String route : router.getRoutes()) {
+            List<Routes> routes = new ArrayList<>();
+            for (Routes route : router.getRoutes()) {
                 routes.add(route);
             }
             result.setRoutes(routes);