You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/12/12 01:47:37 UTC
git commit: updated refs/heads/4.3 to c71e02c
Updated Branches:
refs/heads/4.3 619f5381d -> c71e02c10
CLOUDSTACK-5454: Delete previous template and snapshot after migrating
NFS to S3 throws Error.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c71e02c1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c71e02c1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c71e02c1
Branch: refs/heads/4.3
Commit: c71e02c10cf554974bd632dd983336f73c61150b
Parents: 619f538
Author: Min Chen <mi...@citrix.com>
Authored: Wed Dec 11 16:39:16 2013 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Dec 11 16:39:37 2013 -0800
----------------------------------------------------------------------
.../storage/resource/NfsSecondaryStorageResource.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c71e02c1/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 75d959b..999acc6 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
@@ -862,7 +862,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
ImageFormat format = getTemplateFormat(srcFile.getName());
String key = destData.getPath() + S3Utils.SEPARATOR + srcFile.getName();
if (!s3.getSingleUpload(srcSize)){
- mputFile(s3, srcFile, bucket, key);
+ mputFile(s3, srcFile, bucket, key);
} else{
putFile(s3, srcFile, bucket, key);
}
@@ -1702,6 +1702,10 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
protected Answer execute(final DeleteCommand cmd) {
DataTO obj = cmd.getData();
DataObjectType objType = obj.getObjectType();
+ if (obj.getPath() == null) {
+ // account for those fake entries for NFS migration to object store
+ return new Answer(cmd, true, "Object with null install path does not exist on image store , no need to delete");
+ }
switch (objType) {
case TEMPLATE:
return deleteTemplate(cmd);