mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix secondary storage not working with swift
This commit is contained in:
parent
ad2bcc089e
commit
1e67a5d2c8
@ -356,9 +356,17 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
try {
|
try {
|
||||||
String downloadPath = determineStorageTemplatePath(storagePath, destPath);
|
String downloadPath = determineStorageTemplatePath(storagePath, destPath);
|
||||||
final File downloadDirectory = _storage.getFile(downloadPath);
|
final File downloadDirectory = _storage.getFile(downloadPath);
|
||||||
|
|
||||||
|
if (downloadDirectory.exists()) {
|
||||||
|
s_logger.debug("Directory " + downloadPath + " already exists");
|
||||||
|
} else {
|
||||||
if (!downloadDirectory.mkdirs()) {
|
if (!downloadDirectory.mkdirs()) {
|
||||||
return new CopyCmdAnswer("Failed to create download directory " + downloadPath);
|
final String errMsg = "Unable to create directory " + downloadPath + " to copy from Swift to cache.";
|
||||||
|
s_logger.error(errMsg);
|
||||||
|
return new CopyCmdAnswer(errMsg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File destFile = SwiftUtil.getObject(swiftTO, downloadDirectory, srcData.getPath());
|
File destFile = SwiftUtil.getObject(swiftTO, downloadDirectory, srcData.getPath());
|
||||||
return postProcessing(destFile, downloadPath, destPath, srcData, destData);
|
return postProcessing(destFile, downloadPath, destPath, srcData, destData);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user