You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/06/23 20:29:00 UTC

git commit: updated refs/heads/4.4 to 6b8b7b8

Repository: cloudstack
Updated Branches:
  refs/heads/4.4 f7dd1720c -> 6b8b7b82f


Changed logic for copying snapshot from S3 to NFS staging store to prevent needless failure.

Signed-off-by: Daan Hoogland <da...@onecht.net>
(cherry picked from commit 736bf540e8ef759a101d221622c64f3b3c3ed425)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6b8b7b82
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6b8b7b82
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6b8b7b82

Branch: refs/heads/4.4
Commit: 6b8b7b82f41c415f1e0d1ed715e14f3664e39e22
Parents: f7dd172
Author: Logan B <lb...@tqhosting.com>
Authored: Fri Jun 20 13:27:32 2014 -0400
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jun 23 20:28:04 2014 +0200

----------------------------------------------------------------------
 .../storage/resource/NfsSecondaryStorageResource.java   | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6b8b7b82/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index 6927f02..78f4bf1 100755
--- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
@@ -340,12 +340,14 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
             String downloadPath = determineStorageTemplatePath(storagePath, destPath);
             final File downloadDirectory = _storage.getFile(downloadPath);
 
-            if (!downloadDirectory.mkdirs()) {
-                final String errMsg = "Unable to create directory " + downloadPath + " to copy from S3 to cache.";
-                s_logger.error(errMsg);
-                return new CopyCmdAnswer(errMsg);
-            } else {
+            if (downloadDirectory.exists()) {
                 s_logger.debug("Directory " + downloadPath + " already exists");
+            } else {
+                if (!downloadDirectory.mkdirs()) {
+                    final String errMsg = "Unable to create directory " + downloadPath + " to copy from S3 to cache.";
+                    s_logger.error(errMsg);
+                    return new CopyCmdAnswer(errMsg);
+                }
             }
 
             File destFile = S3Utils.getFile(s3, s3.getBucketName(), srcData.getPath(), downloadDirectory, new FileNamingStrategy() {