Skip to content

Commit e61dda7

Browse files
committed
CLOUDSTACK-6890:createVPC invoked by admin does not observe start flag.
1 parent 9334f26 commit e61dda7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.apache.log4j.Logger;
2020

2121
import org.apache.cloudstack.api.APICommand;
22+
import org.apache.cloudstack.api.ApiConstants;
2223
import org.apache.cloudstack.api.ApiErrorCode;
2324
import org.apache.cloudstack.api.ResponseObject.ResponseView;
2425
import org.apache.cloudstack.api.ServerApiException;
@@ -37,10 +38,14 @@ public class CreateVPCCmdByAdmin extends CreateVPCCmd {
3738
@Override
3839
public void execute() {
3940
Vpc vpc = null;
41+
boolean success = true;
4042
try {
41-
if (_vpcService.startVpc(getEntityId(), true)) {
42-
vpc = _entityMgr.findById(Vpc.class, getEntityId());
43+
if (isStart()) {
44+
success = _vpcService.startVpc(getEntityId(), true);
45+
} else {
46+
s_logger.debug("Not starting VPC as " + ApiConstants.START + "=false was passed to the API");
4347
}
48+
vpc = _entityMgr.findById(Vpc.class, getEntityId());
4449
} catch (ResourceUnavailableException ex) {
4550
s_logger.warn("Exception: ", ex);
4651
throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());

0 commit comments

Comments
 (0)