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)
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)
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
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;
}
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;
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);
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);
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;
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);