mirror of https://github.com/apache/cloudstack.git
CS-15498: Fix delete s2s vpn NPE
This commit is contained in:
parent
a6086dc806
commit
f6aea09a16
|
|
@ -16,20 +16,19 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseAsyncCreateCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.Site2SiteVpnConnectionResponse;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.Site2SiteVpnConnection;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Delete site to site vpn connection", responseObject=Site2SiteVpnConnectionResponse.class)
|
||||
@Implementation(description="Delete site to site vpn connection", responseObject=SuccessResponse.class)
|
||||
public class DeleteVpnConnectionCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteVpnConnectionCmd.class.getName());
|
||||
|
||||
|
|
@ -103,8 +102,7 @@ public class DeleteVpnConnectionCmd extends BaseAsyncCmd {
|
|||
try {
|
||||
Site2SiteVpnConnection result = _s2sVpnService.deleteVpnConnection(this);
|
||||
if (result != null) {
|
||||
Site2SiteVpnConnectionResponse response = _responseGenerator.createSite2SiteVpnConnectionResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete site to site VPN connection");
|
||||
|
|
|
|||
|
|
@ -16,19 +16,18 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.cloud.api.ApiConstants;
|
||||
import com.cloud.api.BaseAsyncCmd;
|
||||
import com.cloud.api.BaseAsyncCreateCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.Site2SiteCustomerGatewayResponse;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.Site2SiteCustomerGateway;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Delete site to site vpn customer gateway", responseObject=Site2SiteCustomerGatewayResponse.class)
|
||||
@Implementation(description="Delete site to site vpn customer gateway", responseObject=SuccessResponse.class)
|
||||
public class DeleteVpnCustomerGatewayCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteVpnCustomerGatewayCmd.class.getName());
|
||||
|
||||
|
|
@ -101,8 +100,7 @@ public class DeleteVpnCustomerGatewayCmd extends BaseAsyncCmd {
|
|||
public void execute(){
|
||||
Site2SiteCustomerGateway result = _s2sVpnService.deleteCustomerGateway(this);
|
||||
if (result != null) {
|
||||
Site2SiteCustomerGatewayResponse response = _responseGenerator.createSite2SiteCustomerGatewayResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete customer VPN gateway");
|
||||
|
|
|
|||
|
|
@ -23,12 +23,13 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.Site2SiteVpnGatewayResponse;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.network.Site2SiteVpnGateway;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Delete site to site vpn gateway", responseObject=Site2SiteVpnGatewayResponse.class)
|
||||
@Implementation(description="Delete site to site vpn gateway", responseObject=SuccessResponse.class)
|
||||
public class DeleteVpnGatewayCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteVpnGatewayCmd.class.getName());
|
||||
|
||||
|
|
@ -101,8 +102,7 @@ public class DeleteVpnGatewayCmd extends BaseAsyncCmd {
|
|||
public void execute(){
|
||||
Site2SiteVpnGateway result = _s2sVpnService.deleteVpnGateway(this);
|
||||
if (result != null) {
|
||||
Site2SiteVpnGatewayResponse response = _responseGenerator.createSite2SiteVpnGatewayResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete customer VPN gateway");
|
||||
|
|
|
|||
Loading…
Reference in New Issue