Skip to content

Commit 3d6cafe

Browse files
authored
Handle null mountTimeout in RestoreBackupCommand (#11944)
1 parent 15c61ac commit 3d6cafe

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

core/src/main/java/org/apache/cloudstack/backup/RestoreBackupCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void setBackupVolumesUUIDs(List<String> backupVolumesUUIDs) {
149149
}
150150

151151
public Integer getMountTimeout() {
152-
return this.mountTimeout;
152+
return this.mountTimeout == null ? 0 : this.mountTimeout;
153153
}
154154

155155
public void setMountTimeout(Integer mountTimeout) {

plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ public Pair<Boolean, String> restoreBackedUpVolume(Backup backup, Backup.VolumeI
405405
restoreCommand.setVmExists(null);
406406
restoreCommand.setVmState(vmNameAndState.second());
407407
restoreCommand.setRestoreVolumeUUID(backupVolumeInfo.getUuid());
408+
restoreCommand.setMountTimeout(NASBackupRestoreMountTimeout.value());
408409

409410
BackupAnswer answer;
410411
try {

0 commit comments

Comments
 (0)