Skip to content

Commit 1d7f622

Browse files
authored
Merge branch '4.22' into ghi13997-saml-slo-session-not-cleared
2 parents 3a768c4 + e3c7b76 commit 1d7f622

108 files changed

Lines changed: 1030 additions & 331 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
@@ -187,6 +187,7 @@ environmnet
187187
equivalant
188188
erro
189189
erronous
190+
errorprone
190191
everthing
191192
everytime
192193
excute

‎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
@@ -452,6 +452,7 @@ public class ApiConstants {
452452
public static final String CURRENT_PASSWORD = "currentpassword";
453453
public static final String SHOULD_UPDATE_PASSWORD = "update_passwd_on_host";
454454
public static final String PASSWORD_ENABLED = "passwordenabled";
455+
public static final String RESET_PASSWORD = "resetpassword";
455456
public static final String SSHKEY_ENABLED = "sshkeyenabled";
456457
public static final String PATH = "path";
457458
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
@@ -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/command/user/vm/CreateVMFromBackupCmd.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ public class CreateVMFromBackupCmd extends BaseDeployVMCmd {
7070
@Parameter(name = ApiConstants.PRESERVE_IP, type = CommandType.BOOLEAN, description = "Use the same IP/MAC addresses as stored in the backup metadata. Works only if the original Instance is deleted and the IP/MAC address is available.")
7171
private Boolean preserveIp;
7272

73+
@Parameter(name = ApiConstants.RESET_PASSWORD, type = CommandType.BOOLEAN,
74+
description = "For a password enabled template, whether to generate a new password for the created Instance and return it in the response. " +
75+
"If not specified, the zone setting `restore.vm.from.backup.reset.password` decides.", since = "4.22.1.0")
76+
private Boolean resetPassword;
77+
7378
/////////////////////////////////////////////////////
7479
/////////////////// Accessors ///////////////////////
7580
/////////////////////////////////////////////////////
@@ -90,6 +95,10 @@ public boolean getPreserveIp() {
9095
return (preserveIp != null) ? preserveIp : false;
9196
}
9297

98+
public Boolean getResetPassword() {
99+
return resetPassword;
100+
}
101+
93102
@Override
94103
public void create() {
95104
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)