Hyunsun Moon
Committed by Gerrit Code Review

Fixed sona refactoring related issues

Change-Id: Ied0ce985921be2fda503fefc6af3388c5289c2d6
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 category="default" url="http://onosproject.org" 18 category="default" url="http://onosproject.org"
19 featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" 19 featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
20 features="${project.artifactId}" 20 features="${project.artifactId}"
21 - apps="org.onosproject.ovsdb-base,org.onosproject.openstackswitching,org.onosproject.dhcp"> 21 + apps="org.onosproject.ovsdb-base,org.onosproject.openstacknetworking,org.onosproject.dhcp">
22 <description>${project.description}</description> 22 <description>${project.description}</description>
23 <artifact>mvn:${project.groupId}/onos-app-cordvtn/${project.version}</artifact> 23 <artifact>mvn:${project.groupId}/onos-app-cordvtn/${project.version}</artifact>
24 </app> 24 </app>
......
...@@ -304,9 +304,26 @@ public class OpenstackNetworkingManager implements OpenstackNetworkingService { ...@@ -304,9 +304,26 @@ public class OpenstackNetworkingManager implements OpenstackNetworkingService {
304 304
305 @Override 305 @Override
306 public OpenstackNetwork network(String networkId) { 306 public OpenstackNetwork network(String networkId) {
307 - return getNetworks().stream() 307 + Collection<OpenstackSubnet> subnets = getSubnets().stream()
308 + .filter(s -> s.networkId().equals(networkId))
309 + .collect(Collectors.toList());
310 +
311 + OpenstackNetwork openstackNetwork = getNetworks().stream()
308 .filter(n -> n.id().equals(networkId)) 312 .filter(n -> n.id().equals(networkId))
309 .findAny().orElse(null); 313 .findAny().orElse(null);
314 +
315 + if (openstackNetwork == null) {
316 + return null;
317 + }
318 +
319 + return OpenstackNetwork.builder()
320 + .id(openstackNetwork.id())
321 + .name(openstackNetwork.name())
322 + .networkType(openstackNetwork.networkType())
323 + .segmentId(openstackNetwork.segmentId())
324 + .tenantId(openstackNetwork.tenantId())
325 + .subnets(subnets)
326 + .build();
310 } 327 }
311 328
312 @Override 329 @Override
......