You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2014/01/29 09:30:53 UTC

[1/2] git commit: updated refs/heads/4.3-forward to ae22d19

Updated Branches:
  refs/heads/4.3-forward 661a19bde -> ae22d1990


Revert "CLOUDSTACK-5900: Failed to delete template/ISO that failed to download."

This reverts commit 0e4b93c6c12f38d5418accac38fbdd28edb86a2c.


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

Branch: refs/heads/4.3-forward
Commit: f5ba6a34f11f9717957acec4c7720f8ce9200d7a
Parents: 661a19b
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Wed Jan 29 12:56:03 2014 +0530
Committer: Sanjay Tripathi <sa...@citrix.com>
Committed: Wed Jan 29 12:57:22 2014 +0530

----------------------------------------------------------------------
 .../resource/NfsSecondaryStorageResource.java       | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f5ba6a34/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 8c1a7e2..f90309d 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
@@ -1740,16 +1740,16 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
                 parent += File.separator;
             }
             String absoluteTemplatePath = parent + relativeTemplatePath;
-            File tmpltDir = new File(absoluteTemplatePath);
+            File tmpltParent = new File(absoluteTemplatePath).getParentFile();
             String details = null;
-            if (!tmpltDir.exists()) {
-                details = "template parent directory " + tmpltDir.getName() + " doesn't exist";
+            if (!tmpltParent.exists()) {
+                details = "template parent directory " + tmpltParent.getName() + " doesn't exist";
                 s_logger.debug(details);
                 return new Answer(cmd, true, details);
             }
-            File[] tmpltFiles = tmpltDir.listFiles();
+            File[] tmpltFiles = tmpltParent.listFiles();
             if (tmpltFiles == null || tmpltFiles.length == 0) {
-                details = "No files under template parent directory " + tmpltDir.getName();
+                details = "No files under template parent directory " + tmpltParent.getName();
                 s_logger.debug(details);
             } else {
                 boolean found = false;
@@ -1776,12 +1776,12 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
                 }
 
                 if (!found) {
-                    details = "Can not find template.properties under " + tmpltDir.getName();
+                    details = "Can not find template.properties under " + tmpltParent.getName();
                     s_logger.debug(details);
                 }
             }
-            if (!tmpltDir.delete()) {
-                details = "Unable to delete directory " + tmpltDir.getName() + " under Template path "
+            if (!tmpltParent.delete()) {
+                details = "Unable to delete directory " + tmpltParent.getName() + " under Template path "
                         + relativeTemplatePath;
                 s_logger.debug(details);
                 return new Answer(cmd, false, details);


[2/2] git commit: updated refs/heads/4.3-forward to ae22d19

Posted by sa...@apache.org.
CLOUDSTACK-5900: Failed to delete template/ISO that failed to download.


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

Branch: refs/heads/4.3-forward
Commit: ae22d1990e081267fdb68b2e014153a8207083c5
Parents: f5ba6a3
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Wed Jan 29 13:52:03 2014 +0530
Committer: Sanjay Tripathi <sa...@citrix.com>
Committed: Wed Jan 29 13:52:03 2014 +0530

----------------------------------------------------------------------
 .../storage/resource/NfsSecondaryStorageResource.java         | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ae22d199/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 f90309d..0ce36ed 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
@@ -1740,7 +1740,12 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
                 parent += File.separator;
             }
             String absoluteTemplatePath = parent + relativeTemplatePath;
-            File tmpltParent = new File(absoluteTemplatePath).getParentFile();
+            File tmpltParent;
+            if(absoluteTemplatePath.endsWith(String.valueOf(obj.getId()))) {
+                tmpltParent = new File(absoluteTemplatePath);
+            } else {
+                tmpltParent = new File(absoluteTemplatePath).getParentFile();
+            }
             String details = null;
             if (!tmpltParent.exists()) {
                 details = "template parent directory " + tmpltParent.getName() + " doesn't exist";