set `desplayName` to `name` by default

This commit is contained in:
Daan Hoogland 2024-09-23 08:58:13 +02:00
parent d15a074425
commit b4ac303ed4
2 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import java.util.Map;
import javax.annotation.Nonnull;
import com.cloud.utils.StringUtils;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.affinity.AffinityGroupResponse;
import org.apache.cloudstack.api.ACL;
@ -55,7 +56,6 @@ import org.apache.cloudstack.context.CallContext;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import com.cloud.agent.api.LogLevel;
@ -283,6 +283,9 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd implements SecurityG
}
public String getDisplayName() {
if (StringUtils.isEmpty(displayName)) {
displayName = name;
}
return displayName;
}

View File

@ -21,6 +21,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.cloud.utils.StringUtils;
import com.cloud.utils.exception.CloudRuntimeException;
import org.apache.cloudstack.api.response.UserDataResponse;
import org.apache.log4j.Logger;
@ -151,6 +152,9 @@ public class UpdateVMCmd extends BaseCustomIdCmd implements SecurityGroupAction,
/////////////////////////////////////////////////////
public String getDisplayName() {
if (StringUtils.isBlank(displayName)) {
displayName = name;
}
return displayName;
}