Skip to content

Commit 15dcfd3

Browse files
author
Daan Hoogland
committed
Merge branch '4.22'
2 parents 8fb3ad4 + 042ec7e commit 15dcfd3

105 files changed

Lines changed: 1172 additions & 378 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ environmnet
184184
equivalant
185185
erro
186186
erronous
187+
errorprone
188+
everthing
187189
everytime
188190
excute
189191
execept

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/com/cloud/vm/VirtualMachineProfile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public static class Param {
7979
public static final Param PreserveNics = new Param("PreserveNics");
8080
public static final Param ConsiderLastHost = new Param("ConsiderLastHost");
8181
public static final Param ReturnAfterVolumePrepare = new Param("ReturnAfterVolumePrepare");
82+
public static final Param ResetPasswordOnRestore = new Param("ResetPasswordOnRestore");
8283

8384
private String name;
8485

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ public class ApiConstants {
470470
public static final String CURRENT_PASSWORD = "currentpassword";
471471
public static final String SHOULD_UPDATE_PASSWORD = "update_passwd_on_host";
472472
public static final String PASSWORD_ENABLED = "passwordenabled";
473+
public static final String RESET_PASSWORD = "resetpassword";
473474
public static final String SSHKEY_ENABLED = "sshkeyenabled";
474475
public static final String PATH = "path";
475476
public static final String PATH_READY = "pathready";

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
@@ -95,8 +95,8 @@ public Boolean getAllowUserDrivenBackups() {
9595
public void execute() {
9696
try {
9797
if (StringUtils.isAllEmpty(getName(), getDescription()) && getAllowUserDrivenBackups() == null && CollectionUtils.isEmpty(getDomainIds())) {
98-
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",
99-
"following should be informed: name, description or allowUserDrivenBackups.", id));
98+
throw new InvalidParameterValueException(String.format("Can't update Backup Offering [id: %s] because there are no parameters to be updated," +
99+
" at least one of the following should be passed: name, description or allowUserDrivenBackups.", id));
100100
}
101101

102102
BackupOffering result = backupManager.updateBackupOffering(this);

api/src/main/java/org/apache/cloudstack/api/command/user/vm/CreateVMFromBackupCmd.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public class CreateVMFromBackupCmd extends BaseDeployVMCmd {
7575
"Currently this parameter is only supported by the KBOSS provider.", since = "4.23.0")
7676
private Boolean quickRestore;
7777

78+
@Parameter(name = ApiConstants.RESET_PASSWORD, type = CommandType.BOOLEAN,
79+
description = "For a password enabled template, whether to generate a new password for the created Instance and return it in the response. " +
80+
"If not specified, the zone setting `restore.vm.from.backup.reset.password` decides.", since = "4.22.1.0")
81+
private Boolean resetPassword;
82+
7883
/////////////////////////////////////////////////////
7984
/////////////////// Accessors ///////////////////////
8085
/////////////////////////////////////////////////////
@@ -99,6 +104,10 @@ public Boolean getQuickRestore() {
99104
return ObjectUtils.defaultIfNull(this.quickRestore, false);
100105
}
101106

107+
public Boolean getResetPassword() {
108+
return resetPassword;
109+
}
110+
102111
@Override
103112
public void create() {
104113
UserVm vm;

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

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
@@ -538,7 +538,7 @@ private List<String> getRulesForPool(final LoadBalancerTO lbTO, final LoadBalanc
538538
}
539539
dstSubRule.add(sb.toString());
540540
if (stickinessSubRule != null) {
541-
sb.append(" cookie ").append(dest.getDestIp().replace(".", "_")).append('-').append(dest.getDestPort()).toString();
541+
sb.append(" cookie ").append(dest.getDestIp().replace(".", "_")).append('-').append(dest.getDestPort());
542542
dstWithCookieSubRule.add(sb.toString());
543543
}
544544
destsAvailable = true;

core/src/main/java/com/cloud/resource/RequestWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected CommandWrapper<Command, Answer, ServerResource> retrieveCommands(final
8686

8787
keepCommandClass = commandClass2;
8888
} catch (final ClassCastException e) {
89-
throw new CommandNotSupported("No key found for '" + keepCommandClass.getClass() + "' in the Map!");
89+
throw new CommandNotSupported("No key found for '" + keepCommandClass + "' in the Map!");
9090
} catch (final NullPointerException e) {
9191
// Will now traverse all the resource hierarchy. Returning null
9292
// is not a problem.

0 commit comments

Comments
 (0)