diff --git a/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/controller/SubnetController.java b/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/controller/SubnetController.java index 174a2b201..049269cb2 100644 --- a/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/controller/SubnetController.java +++ b/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/controller/SubnetController.java @@ -58,6 +58,8 @@ free of charge, to any person obtaining a copy of this software and associated d import static com.futurewei.alcor.common.constants.CommonConstants.QUERY_ATTR_HEADER; import static org.springframework.web.bind.annotation.RequestMethod.*; +import org.springframework.web.client.HttpClientErrorException; + @RestController @ComponentScan(value = "com.futurewei.alcor.common.stats") public class SubnetController { @@ -537,7 +539,11 @@ public ResponseId deleteSubnetState(@PathVariable String projectId, @PathVariabl } // delete subnet routing rule in route manager - this.subnetService.deleteSubnetRoutingRuleInRM(projectId, subnetId); + try { + this.subnetService.deleteSubnetRoutingTable(projectId, subnetId); + } catch (HttpClientErrorException.NotFound e) { + logger.warn(e.getMessage()); + } // TODO: delete gateway port in port manager. Temporary solution, need PM fix issue GatewayPortDetail gatewayPortDetail = subnetEntity.getGatewayPortDetail(); diff --git a/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/service/SubnetService.java b/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/service/SubnetService.java index a1771ce78..382880e8d 100644 --- a/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/service/SubnetService.java +++ b/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/service/SubnetService.java @@ -88,7 +88,7 @@ public void fallbackOperation (AtomicReference routeResponseAtomic public void updateSubnetHostRoutes (String subnetId, NewHostRoutes resource) throws ResourceNotFoundException, ResourcePersistenceException, DatabasePersistenceException, SubnetEntityNotFound, DestinationOrOperationTypeIsNull; // delete subnet routing rule in route manager - public void deleteSubnetRoutingRuleInRM (String projectId, String subnetId) throws SubnetIdIsNull; + public void deleteSubnetRoutingTable (String projectId, String subnetId) throws SubnetIdIsNull; // update subnet routing rule in route manager public void updateSubnetRoutingRuleInRM (String projectId, String subnetId, SubnetEntity subnetEntity) throws SubnetIdIsNull; diff --git a/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/service/implement/SubnetServiceImp.java b/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/service/implement/SubnetServiceImp.java index 48bc9396a..85fa2f340 100644 --- a/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/service/implement/SubnetServiceImp.java +++ b/services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/service/implement/SubnetServiceImp.java @@ -535,7 +535,7 @@ public void updateSubnetHostRoutes(String subnetId, NewHostRoutes resource) thro @Override - public void deleteSubnetRoutingRuleInRM(String projectId, String subnetId) throws SubnetIdIsNull { + public void deleteSubnetRoutingTable(String projectId, String subnetId) throws SubnetIdIsNull { if (subnetId == null) { throw new SubnetIdIsNull();