mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +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;
|
import com.cloud.utils.fsm.StateObject;
|
||||||
|
|
||||||
public interface VirtualMachineTemplate extends ControlledEntity, Identity, InternalIdentity, StateObject<VirtualMachineTemplate.State> {
|
public interface VirtualMachineTemplate extends ControlledEntity, Identity, InternalIdentity, StateObject<VirtualMachineTemplate.State> {
|
||||||
|
int MAXIMUM_TEMPLATE_NAME_LENGTH = 255;
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
Active,
|
Active,
|
||||||
Inactive,
|
Inactive,
|
||||||
|
|||||||
@ -106,17 +106,17 @@ public class CreateTagsCmd extends BaseAsyncCmd {
|
|||||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||||
setResponseObject(response);
|
setResponseObject(response);
|
||||||
} else {
|
} 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
|
@Override
|
||||||
public String getEventType() {
|
public String getEventType() {
|
||||||
return EventTypes.EVENT_RESOURCE_ICON_UPLOAD;
|
return EventTypes.EVENT_TAGS_CREATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getEventDescription() {
|
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);
|
_accountMgr.checkAccess(caller, null, true, templateOwner);
|
||||||
|
|
||||||
String name = cmd.getTemplateName();
|
String name = cmd.getTemplateName();
|
||||||
if ((name == null) || (name.length() > 32)) {
|
if ((org.apache.commons.lang3.StringUtils.isBlank(name)
|
||||||
throw new InvalidParameterValueException("Template name cannot be null and should be less than 32 characters");
|
|| (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) {
|
if (cmd.getTemplateTag() != null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user