cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [07/50] [abbrv] git commit: updated refs/heads/master to 97f8c52
Date Thu, 20 Jun 2013 07:19:40 GMT
Fix a bug in copyFromS3ToNfs code about path.


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

Branch: refs/heads/master
Commit: c78f3984fee809386a72674daf8930458e62807d
Parents: 4e40495
Author: Min Chen <min.chen@citrix.com>
Authored: Thu Jun 6 14:06:10 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu Jun 6 14:06:26 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c78f3984/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
b/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index d6a2af4..228024e 100755
--- a/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ b/services/secondary-storage/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
@@ -245,22 +245,13 @@ public class NfsSecondaryStorageResource extends ServerResourceBase
implements S
                 s_logger.debug("Directory " + downloadPath + " already exists");
             }
 
-            List<File> files = getDirectory(s3, s3.getBucketName(), destPath, downloadDirectory,
new FileNamingStrategy() {
+            File destFile = S3Utils.getFile(s3, s3.getBucketName(), srcData.getPath(), downloadDirectory,
new FileNamingStrategy() {
                 @Override
                 public String determineFileName(final String key) {
                     return substringAfterLast(key, S3Utils.SEPARATOR);
                 }
             });
 
-            // find out template name
-            File destFile = null;
-            for (File f : files) {
-                if (!f.getName().endsWith(".properties")) {
-                    destFile = f;
-                    break;
-                }
-            }
-
             if (destFile == null) {
                 return new CopyCmdAnswer("Can't find template");
             }
@@ -335,6 +326,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements
S
         }
     }
 
+
     protected Answer copySnapshotToTemplateFromNfsToNfsXenserver(CopyCommand cmd, SnapshotObjectTO
srcData, NfsTO srcDataStore,
             TemplateObjectTO destData, NfsTO destDataStore) {
         String srcMountPoint = this.getRootDir(srcDataStore.getUrl());


Mime
View raw message