mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Nas BnR: Fix for restore not working correctly (#10785)
This commit is contained in:
parent
c45ed06098
commit
2674da2ee9
@ -150,16 +150,16 @@ public class LibvirtRestoreBackupCommandWrapper extends CommandWrapper<RestoreBa
|
||||
String mountDirectory = String.format("%s.%s",BACKUP_TEMP_FILE_PREFIX , randomChars);
|
||||
try {
|
||||
mountDirectory = Files.createTempDirectory(mountDirectory).toString();
|
||||
String mountOpts = null;
|
||||
if (Objects.nonNull(mountOptions)) {
|
||||
mountOpts = mountOptions;
|
||||
if ("cifs".equals(backupRepoType)) {
|
||||
mountOpts += ",nobrl";
|
||||
}
|
||||
}
|
||||
String mount = String.format(MOUNT_COMMAND, backupRepoType, backupRepoAddress, mountDirectory);
|
||||
if (Objects.nonNull(mountOpts)) {
|
||||
mount += " -o " + mountOpts;
|
||||
if ("cifs".equals(backupRepoType)) {
|
||||
if (Objects.isNull(mountOptions) || mountOptions.trim().isEmpty()) {
|
||||
mountOptions = "nobrl";
|
||||
} else {
|
||||
mountOptions += ",nobrl";
|
||||
}
|
||||
}
|
||||
if (Objects.nonNull(mountOptions) && !mountOptions.trim().isEmpty()) {
|
||||
mount += " -o " + mountOptions;
|
||||
}
|
||||
Script.runSimpleBashScript(mount);
|
||||
} catch (Exception e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user