Fix an issue of createVolumeCmd for regular user.

This commit is contained in:
Min Chen 2013-06-26 15:38:57 -07:00
parent 53d1ce75a1
commit a654e52cb6

View File

@ -55,7 +55,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
description="the domain ID associated with the disk offering. If used with the account parameter" +
" returns the disk volume associated with the account for the specified domain.")
" returns the disk volume associated with the account for the specified domain.")
private Long domainId;
@Parameter(name=ApiConstants.DISK_OFFERING_ID,required = false, type=CommandType.UUID, entityType=DiskOfferingResponse.class,
@ -79,7 +79,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
@Parameter(name=ApiConstants.DISPLAY_VOLUME, type=CommandType.BOOLEAN, description="an optional field, whether to display the volume to the end user or not.")
private Boolean displayVolume;
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@ -117,7 +117,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
}
public Boolean getDisplayVolume() {
return displayVolume != null ? displayVolume : Boolean.TRUE;
return displayVolume;
}
/////////////////////////////////////////////////////
@ -132,6 +132,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
return "volume";
}
@Override
public AsyncJob.Type getInstanceType() {
return AsyncJob.Type.Volume;
}
@ -179,12 +180,12 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
Snapshot snap = _entityMgr.findById(Snapshot.class, getSnapshotId());
if (snap != null) {
response.setSnapshotId(snap.getUuid()); // if the volume was
// created from a
// snapshot,
// snapshotId will
// be set so we pass
// it back in the
// response
// created from a
// snapshot,
// snapshotId will
// be set so we pass
// it back in the
// response
}
}
response.setResponseName(getCommandName());