Skip to content

Commit 9f3f7f3

Browse files
authored
Merge branch '4.20' into fix-ldapconf-list-pagination
2 parents 9f360fa + 9c8bdf3 commit 9f3f7f3

111 files changed

Lines changed: 704 additions & 341 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/linters/codespell.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ environmnet
188188
equivalant
189189
erro
190190
erronous
191+
errorprone
191192
everthing
192193
everytime
193194
excetion

agent/src/main/java/com/cloud/agent/mockvm/MockVmMgr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public void freeVncPort(int port) {
249249
public MockVm createVmFromSpec(VirtualMachineTO vmSpec) {
250250
String vmName = vmSpec.getName();
251251
long ramSize = vmSpec.getMinRam();
252-
int utilizationPercent = randSeed.nextInt() % 100;
252+
int utilizationPercent = randSeed.nextInt(100);
253253
MockVm vm = null;
254254

255255
synchronized (this) {

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ public class ApiConstants {
451451
public static final String SERIAL = "serial";
452452
public static final String SERVICE_IP = "serviceip";
453453
public static final String SERVICE_OFFERING_ID = "serviceofferingid";
454+
public static final String SERVICE_OFFERING_NAME = "serviceofferingname";
454455
public static final String SESSIONKEY = "sessionkey";
455456
public static final String SHOW_CAPACITIES = "showcapacities";
456457
public static final String SHOW_REMOVED = "showremoved";

api/src/main/java/org/apache/cloudstack/api/command/admin/backup/UpdateBackupOfferingCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public Boolean getAllowUserDrivenBackups() {
8383
public void execute() {
8484
try {
8585
if (StringUtils.isAllEmpty(getName(), getDescription()) && getAllowUserDrivenBackups() == null) {
86-
throw new InvalidParameterValueException(String.format("Can't update Backup Offering [id: %s] because there are no parameters to be updated, at least one of the",
87-
"following should be informed: name, description or allowUserDrivenBackups.", id));
86+
throw new InvalidParameterValueException(String.format("Can't update Backup Offering [id: %s] because there are no parameters to be updated," +
87+
" at least one of the following should be passed: name, description or allowUserDrivenBackups.", id));
8888
}
8989

9090
BackupOffering result = backupManager.updateBackupOffering(this);

api/src/main/java/org/apache/cloudstack/api/response/NetworkOfferingResponse.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public class NetworkOfferingResponse extends BaseResponseWithAnnotations {
9191
@Param(description = "The ID of the service offering used by virtual router provider")
9292
private String serviceOfferingId;
9393

94+
@SerializedName(ApiConstants.SERVICE_OFFERING_NAME)
95+
@Param(description = "the name of the service offering used by virtual router provider")
96+
private String serviceOfferingName;
97+
9498
@SerializedName(ApiConstants.SERVICE)
9599
@Param(description = "The list of supported services", responseObject = ServiceResponse.class)
96100
private List<ServiceResponse> services;
@@ -330,4 +334,12 @@ public String getRoutingMode() {
330334
public void setRoutingMode(String routingMode) {
331335
this.routingMode = routingMode;
332336
}
337+
338+
public String getServiceOfferingName() {
339+
return serviceOfferingName;
340+
}
341+
342+
public void setServiceOfferingName(String serviceOfferingName) {
343+
this.serviceOfferingName = serviceOfferingName;
344+
}
333345
}

api/src/main/java/org/apache/cloudstack/api/response/ProjectResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public void setNetworkAvailable(String networkAvailable) {
362362

363363
@Override
364364
public void setVpcLimit(String vpcLimit) {
365-
this.vpcLimit = networkLimit;
365+
this.vpcLimit = vpcLimit;
366366
}
367367

368368
@Override

api/src/test/java/com/cloud/network/IsolationMethodTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
public class IsolationMethodTest {
2626
@After
2727
public void cleanTheRegistry() {
28-
PhysicalNetwork.IsolationMethod.registeredIsolationMethods.removeAll(PhysicalNetwork.IsolationMethod.registeredIsolationMethods);
28+
PhysicalNetwork.IsolationMethod.registeredIsolationMethods.clear();
2929
}
3030

3131
@Test
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.api.response;
18+
19+
import org.junit.Assert;
20+
import org.junit.Test;
21+
import org.springframework.test.util.ReflectionTestUtils;
22+
23+
public class ProjectResponseTest {
24+
25+
@Test
26+
public void setVpcLimitStoresItsOwnParameterNotTheNetworkLimit() {
27+
ProjectResponse response = new ProjectResponse();
28+
response.setNetworkLimit("5");
29+
response.setVpcLimit("10");
30+
31+
Assert.assertEquals("10", ReflectionTestUtils.getField(response, "vpcLimit"));
32+
Assert.assertEquals("5", ReflectionTestUtils.getField(response, "networkLimit"));
33+
}
34+
}

core/src/main/java/com/cloud/agent/resource/virtualnetwork/facade/AbstractConfigItemFacade.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public abstract class AbstractConfigItemFacade {
106106

107107
public static AbstractConfigItemFacade getInstance(final Class<? extends NetworkElementCommand> key) {
108108
if (!flyweight.containsKey(key)) {
109-
throw new CloudRuntimeException("Unable to process the configuration for " + key.getClass().getName());
109+
throw new CloudRuntimeException("Unable to process the configuration for " + key.getName());
110110
}
111111

112112
final AbstractConfigItemFacade instance = flyweight.get(key);

core/src/main/java/com/cloud/network/HAProxyConfigurator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ private List<String> getRulesForPool(final LoadBalancerTO lbTO, final boolean ke
514514
}
515515
dstSubRule.add(sb.toString());
516516
if (stickinessSubRule != null) {
517-
sb.append(" cookie ").append(dest.getDestIp().replace(".", "_")).append('-').append(dest.getDestPort()).toString();
517+
sb.append(" cookie ").append(dest.getDestIp().replace(".", "_")).append('-').append(dest.getDestPort());
518518
dstWithCookieSubRule.add(sb.toString());
519519
}
520520
destsAvailable = true;

0 commit comments

Comments
 (0)