Skip to content

Commit cefaa84

Browse files
committed
Merge remote-tracking branch 'origin/hotfix/4.4-7343' into 4.4
2 parents 018bcd2 + 62d9843 commit cefaa84

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,17 @@ protected Answer copyFromSwiftToNfs(CopyCommand cmd, DataTO srcData, SwiftTO swi
320320
try {
321321
String downloadPath = determineStorageTemplatePath(storagePath, destPath);
322322
final File downloadDirectory = _storage.getFile(downloadPath);
323-
if (!downloadDirectory.mkdirs()) {
324-
return new CopyCmdAnswer("Failed to create download directory " + downloadPath);
323+
324+
if (downloadDirectory.exists()) {
325+
s_logger.debug("Directory " + downloadPath + " already exists");
326+
} else {
327+
if (!downloadDirectory.mkdirs()) {
328+
final String errMsg = "Unable to create directory " + downloadPath + " to copy from Swift to cache.";
329+
s_logger.error(errMsg);
330+
return new CopyCmdAnswer(errMsg);
331+
}
325332
}
333+
326334
File destFile = SwiftUtil.getObject(swiftTO, downloadDirectory, srcData.getPath());
327335
return postProcessing(destFile, downloadPath, destPath, srcData, destData);
328336
} catch (Exception e) {

0 commit comments

Comments
 (0)