File tree Expand file tree Collapse file tree
api/src/org/apache/cloudstack/api/command/admin/vpc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import org .apache .log4j .Logger ;
2020
2121import org .apache .cloudstack .api .APICommand ;
22+ import org .apache .cloudstack .api .ApiConstants ;
2223import org .apache .cloudstack .api .ApiErrorCode ;
2324import org .apache .cloudstack .api .ResponseObject .ResponseView ;
2425import 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 ());
You can’t perform that action at this time.
0 commit comments