cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject git commit: updated refs/heads/master to 53b0bf6
Date Mon, 11 Nov 2013 05:36:30 GMT
Updated Branches:
  refs/heads/master 4473bb218 -> 53b0bf673


Template/ISO download fails cause the object to disappear from UI in 4.2

Signed-off-by: Koushik Das <koushik@apache.org>


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

Branch: refs/heads/master
Commit: 53b0bf6733d28cb104a231f28f58c7f1dff11742
Parents: 4473bb2
Author: Harikrishna Patnala <harikrishna.patnala@citrix.com>
Authored: Thu Nov 7 17:07:56 2013 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Mon Nov 11 10:58:43 2013 +0530

----------------------------------------------------------------------
 .../storage/datastore/ObjectInDataStoreManagerImpl.java     | 9 ++-------
 .../src/com/cloud/template/HypervisorTemplateAdapter.java   | 6 +-----
 2 files changed, 3 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53b0bf67/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
index 652df43..d9a5164 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
@@ -86,6 +86,7 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager
{
     public ObjectInDataStoreManagerImpl() {
         stateMachines = new StateMachine2<State, Event, DataObjectInStore>();
         stateMachines.addTransition(State.Allocated, Event.CreateOnlyRequested, State.Creating);
+        stateMachines.addTransition(State.Allocated, Event.DestroyRequested, State.Destroying);
         stateMachines.addTransition(State.Creating, Event.OperationFailed, State.Allocated);
         stateMachines.addTransition(State.Creating, Event.OperationSuccessed, State.Ready);
         stateMachines.addTransition(State.Ready, Event.CopyingRequested, State.Copying);
@@ -256,13 +257,7 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager
{
             // Image store
             switch (dataObj.getType()) {
             case TEMPLATE:
-                TemplateDataStoreVO destTmpltStore = templateDataStoreDao.findByStoreTemplate(dataStore.getId(),
objId);
-                if (destTmpltStore != null && destTmpltStore.getState() != ObjectInDataStoreStateMachine.State.Ready)
{
-                    return templateDataStoreDao.remove(destTmpltStore.getId());
-                } else {
-                    s_logger.warn("Template " + objId + " is not found on image store " +
dataStore.getId() + ", so no need to delete");
-                    return true;
-                }
+                return true;
             case SNAPSHOT:
                 SnapshotDataStoreVO destSnapshotStore = snapshotDataStoreDao.findByStoreSnapshot(dataStore.getRole(),
dataStore.getId(), objId);
                 if (destSnapshotStore != null && destSnapshotStore.getState() !=
ObjectInDataStoreStateMachine.State.Ready) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53b0bf67/server/src/com/cloud/template/HypervisorTemplateAdapter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
index b33a192..f981997 100755
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -233,11 +233,7 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
             CreateTemplateContext<TemplateApiResult> context) {
         TemplateApiResult result = callback.getResult();
         TemplateInfo template = context.template;
-        if (result.isFailed()) {
-            // failed in creating template, we need to remove those already
-            // populated template entry
-            _tmpltDao.remove(template.getId());
-        } else {
+        if (result.isSuccess()) {
             VMTemplateVO tmplt = _tmpltDao.findById(template.getId());
             long accountId = tmplt.getAccountId();
             if (template.getSize() != null) {


Mime
View raw message