mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.17'
This commit is contained in:
commit
784578d46c
@ -30,6 +30,8 @@ import com.cloud.utils.fsm.StateMachine2;
|
||||
import com.cloud.utils.fsm.StateObject;
|
||||
|
||||
public interface VirtualMachineTemplate extends ControlledEntity, Identity, InternalIdentity, StateObject<VirtualMachineTemplate.State> {
|
||||
int MAXIMUM_TEMPLATE_NAME_LENGTH = 255;
|
||||
|
||||
enum State {
|
||||
Active,
|
||||
Inactive,
|
||||
|
||||
@ -106,17 +106,17 @@ public class CreateTagsCmd extends BaseAsyncCmd {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to upload resource icon");
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create resource tag(s)");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_RESOURCE_ICON_UPLOAD;
|
||||
return EventTypes.EVENT_TAGS_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Uploading resource icon";
|
||||
return "Creating resource tag(s)";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1749,8 +1749,9 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
||||
_accountMgr.checkAccess(caller, null, true, templateOwner);
|
||||
|
||||
String name = cmd.getTemplateName();
|
||||
if ((name == null) || (name.length() > 32)) {
|
||||
throw new InvalidParameterValueException("Template name cannot be null and should be less than 32 characters");
|
||||
if ((org.apache.commons.lang3.StringUtils.isBlank(name)
|
||||
|| (name.length() > VirtualMachineTemplate.MAXIMUM_TEMPLATE_NAME_LENGTH))) {
|
||||
throw new InvalidParameterValueException(String.format("Template name cannot be null and cannot be more %s characters", VirtualMachineTemplate.MAXIMUM_TEMPLATE_NAME_LENGTH));
|
||||
}
|
||||
|
||||
if (cmd.getTemplateTag() != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user