mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 9596 : Make the iso extractable by default.
status 9596: resolved fixed
This commit is contained in:
parent
77de414c81
commit
714ab83fa1
@ -24,6 +24,7 @@ import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.BaseCmd.CommandType;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.TemplateResponse;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
@ -54,6 +55,9 @@ public class RegisterIsoCmd extends BaseCmd {
|
||||
@Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="true if you want to register the ISO to be publicly available to all users, false otherwise.")
|
||||
private Boolean publicIso;
|
||||
|
||||
@Parameter(name=ApiConstants.IS_EXTRACTABLE, type=CommandType.BOOLEAN, description="true if the iso or its derivatives are extractable; default is true")
|
||||
private Boolean extractable;
|
||||
|
||||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the ISO")
|
||||
private String isoName;
|
||||
|
||||
@ -92,6 +96,10 @@ public class RegisterIsoCmd extends BaseCmd {
|
||||
return publicIso;
|
||||
}
|
||||
|
||||
public Boolean isExtractable() {
|
||||
return extractable;
|
||||
}
|
||||
|
||||
public String getIsoName() {
|
||||
return isoName;
|
||||
}
|
||||
|
||||
@ -1612,6 +1612,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
||||
}
|
||||
|
||||
templateResponse.setFeatured(template.isFeatured());
|
||||
templateResponse.setExtractable(template.isExtractable());
|
||||
templateResponse.setBootable(template.isBootable());
|
||||
templateResponse.setOsTypeId(template.getGuestOSId());
|
||||
templateResponse.setOsTypeName(ApiDBUtils.findGuestOSById(template.getGuestOSId()).getDisplayName());
|
||||
|
||||
@ -113,9 +113,6 @@ public abstract class TemplateAdapterBase implements TemplateAdapter {
|
||||
guestOSId = 138L; //Guest os id of None.
|
||||
}
|
||||
} else {
|
||||
if (isExtractable == null) {
|
||||
isExtractable = Boolean.TRUE;
|
||||
}
|
||||
if (bits == null) {
|
||||
bits = Integer.valueOf(64);
|
||||
}
|
||||
@ -127,6 +124,9 @@ public abstract class TemplateAdapterBase implements TemplateAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
if (isExtractable == null) {
|
||||
isExtractable = Boolean.TRUE;
|
||||
}
|
||||
if ((accountName == null) ^ (domainId == null)) {// XOR - Both have to be passed or don't pass any of them
|
||||
throw new InvalidParameterValueException("Please specify both account and domainId or dont specify any of them");
|
||||
}
|
||||
@ -241,7 +241,7 @@ public abstract class TemplateAdapterBase implements TemplateAdapter {
|
||||
|
||||
public TemplateProfile prepare(RegisterIsoCmd cmd) throws ResourceAllocationException {
|
||||
return prepare(true, UserContext.current().getCallerUserId(), cmd.getIsoName(), cmd.getDisplayText(), 64, false,
|
||||
true, cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(), true, ImageFormat.ISO.toString(), cmd.getOsTypeId(),
|
||||
true, cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(), cmd.isExtractable(), ImageFormat.ISO.toString(), cmd.getOsTypeId(),
|
||||
cmd.getZoneId(), HypervisorType.None, cmd.getAccountName(), cmd.getDomainId(), null, cmd.isBootable());
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user