Repository: stratos
Updated Branches:
  refs/heads/4.0.0-grouping bdd9443ed -> b52735ee7


fixing issue when undeploying servicegroup - Cannot Undeploy Group which is 
Already Deployed


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

Branch: refs/heads/4.0.0-grouping
Commit: b52735ee788d4d2370c892db6aecc8d9ec6387a7
Parents: bdd9443
Author: Martin Eppel <[email protected]>
Authored: Thu Oct 2 13:36:52 2014 -0700
Committer: Martin Eppel <[email protected]>
Committed: Thu Oct 2 13:36:52 2014 -0700

----------------------------------------------------------------------
 .../cloud/controller/impl/CloudControllerServiceImpl.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b52735ee/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
index 5b04df2..0901944 100644
--- 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
+++ 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
@@ -333,15 +333,19 @@ public class CloudControllerServiceImpl implements 
CloudControllerService {
         }
        
         ServiceGroup serviceGroup = null;
-        if((serviceGroup = dataHolder.getServiceGroup(name)) != null) {
-            if (dataHolder.getServiceGroups().remove(name)) {
+        
+        serviceGroup = dataHolder.getServiceGroup(name);
+        
+        if (serviceGroup  != null) {
+            if (dataHolder.getServiceGroups().remove(serviceGroup)) {
                 persist();
                 if(log.isInfoEnabled()) {
                     log.info("Successfully undeployed the Service Group 
definition: " + serviceGroup);
                 }
                 return;
             }
-        }
+        } 
+        
         String msg = "ServiceGroup " + name + " is not a deployed Service 
Group definition";
         log.error(msg);
         throw new InvalidServiceGroupException(msg);

Reply via email to