stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [2/2] stratos git commit: Fixing partition validation logic in kubernetes partition validator
Date Mon, 22 Dec 2014 05:15:23 GMT
Fixing partition validation logic in kubernetes partition validator


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

Branch: refs/heads/master
Commit: 3343cf743b1994dfb3683816b93f99a81491ff5f
Parents: 1c8c127
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Mon Dec 22 10:43:26 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Mon Dec 22 10:43:26 2014 +0530

----------------------------------------------------------------------
 .../iaases/mock/MockPartitionValidator.java     |  3 ++-
 .../validators/AWSEC2PartitionValidator.java    | 21 +++++++++-----------
 .../CloudstackPartitionValidator.java           | 11 +++++-----
 .../validators/DockerPartitionValidator.java    |  3 ++-
 .../validators/GCEPartitionValidator.java       |  5 ++---
 .../KubernetesPartitionValidator.java           | 14 +++++++------
 .../OpenstackNovaPartitionValidator.java        | 18 ++++++++---------
 .../iaases/validators/PartitionValidator.java   |  5 +++--
 .../validators/VCloudPartitionValidator.java    |  3 ++-
 .../impl/CloudControllerServiceUtil.java        | 10 +++-------
 10 files changed, 45 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockPartitionValidator.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockPartitionValidator.java
index ef7ae94..d3ca6d6 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockPartitionValidator.java
@@ -20,6 +20,7 @@
 package org.apache.stratos.cloud.controller.iaases.mock;
 
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
+import org.apache.stratos.cloud.controller.domain.Partition;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.validators.PartitionValidator;
 
@@ -38,7 +39,7 @@ public class MockPartitionValidator implements PartitionValidator {
     }
 
     @Override
-    public IaasProvider validate(String partitionId, Properties properties) throws InvalidPartitionException
{
+    public IaasProvider validate(Partition partition, Properties properties) throws InvalidPartitionException
{
         return iaasProvider;
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java
index 4d16c87..6b85913 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java
@@ -20,6 +20,7 @@ package org.apache.stratos.cloud.controller.iaases.validators;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.cloud.controller.domain.Partition;
 import org.apache.stratos.cloud.controller.exception.InvalidIaasProviderException;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
@@ -43,7 +44,7 @@ public class AWSEC2PartitionValidator implements PartitionValidator {
     private Iaas iaas;
 
     @Override
-    public IaasProvider validate(String partitionId, Properties properties) throws InvalidPartitionException
{
+    public IaasProvider validate(Partition partition, Properties properties) throws InvalidPartitionException
{
         // validate the existence of the region and zone properties.
         try {
             if (properties.containsKey(Scope.region.toString())) {
@@ -51,17 +52,15 @@ public class AWSEC2PartitionValidator implements PartitionValidator {
                 
                 if (iaasProvider.getImage() != null && !iaasProvider.getImage().contains(region))
{
 
-                    String msg =
-                                 "Invalid Partition Detected : " + partitionId +
-                                         " - Cause: Invalid Region: " + region;
-                    log.error(msg);
-                    throw new InvalidPartitionException(msg);
+                    String message = "Invalid partition detected, invalid region: [partition-id]
" + partition.getId() +
+                                         " [region] " + region;
+                    log.error(message);
+                    throw new InvalidPartitionException(message);
                 } 
                 
                 iaas.isValidRegion(region);
                 
                 IaasProvider updatedIaasProvider = new IaasProvider(iaasProvider);
-                
                 Iaas updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
                 updatedIaas.setIaasProvider(updatedIaasProvider);
                 
@@ -74,7 +73,6 @@ public class AWSEC2PartitionValidator implements PartitionValidator {
                 } 
                 
                 updateOtherProperties(updatedIaasProvider, properties);
-                
                 return updatedIaasProvider;
                 
             } else {
@@ -82,11 +80,10 @@ public class AWSEC2PartitionValidator implements PartitionValidator {
                 return iaasProvider;
             }
         } catch (Exception ex) {
-            String msg = "Invalid Partition Detected : "+partitionId+". Cause: "+ex.getMessage();
-            log.error(msg, ex);
-            throw new InvalidPartitionException(msg, ex);
+            String message = "Invalid partition detected: [partition-id] " + partition.getId();
+            log.error(message, ex);
+            throw new InvalidPartitionException(message, ex);
         }
-        
     }
 
     private void updateOtherProperties(IaasProvider updatedIaasProvider,

http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java
index 70b32dd..f1bb11d 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java
@@ -2,6 +2,7 @@ package org.apache.stratos.cloud.controller.iaases.validators;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.cloud.controller.domain.Partition;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
@@ -26,7 +27,7 @@ public class CloudstackPartitionValidator implements PartitionValidator
{
     }
 
     @Override
-    public IaasProvider validate(String partitionId, Properties properties) throws InvalidPartitionException
{
+    public IaasProvider validate(Partition partition, Properties properties) throws InvalidPartitionException
{
 
         try {
             IaasProvider updatedIaasProvider = new IaasProvider(iaasProvider);
@@ -41,10 +42,10 @@ public class CloudstackPartitionValidator implements PartitionValidator
{
                 updatedIaas.setIaasProvider(updatedIaasProvider);
             }
 
-        } catch (Exception ex) {
-            String msg = "Invalid Partition Detected : "+partitionId+". Cause: "+ex.getMessage();
-            log.error(msg, ex);
-            throw new InvalidPartitionException(msg, ex);
+        } catch (Exception e) {
+            String msg = "Invalid partition detected: [partition-id] " + partition.getId()
+ e.getMessage();
+            log.error(msg, e);
+            throw new InvalidPartitionException(msg, e);
         }
         return iaasProvider;
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java
index 1a54297..46259d6 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java
@@ -22,6 +22,7 @@ package org.apache.stratos.cloud.controller.iaases.validators;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
+import org.apache.stratos.cloud.controller.domain.Partition;
 import org.apache.stratos.cloud.controller.exception.InvalidIaasProviderException;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
@@ -44,7 +45,7 @@ public class DockerPartitionValidator implements PartitionValidator {
     }
 
     @Override
-    public IaasProvider validate(String partitionId, Properties properties) throws InvalidPartitionException
{
+    public IaasProvider validate(Partition partition, Properties properties) throws InvalidPartitionException
{
     	// in Docker case currently we only update the custom properties passed via Partitions,
and
     	// no validation done as of now.
     	IaasProvider updatedIaasProvider = new IaasProvider(iaasProvider);

http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/GCEPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/GCEPartitionValidator.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/GCEPartitionValidator.java
index 4f119ac..f828ccd 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/GCEPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/GCEPartitionValidator.java
@@ -22,6 +22,7 @@ import java.util.Properties;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.cloud.controller.domain.Partition;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
@@ -38,10 +39,8 @@ public class GCEPartitionValidator implements PartitionValidator {
     private IaasProvider iaasProvider;
 
     @Override
-    public IaasProvider validate(String partitionId, Properties properties) throws InvalidPartitionException
{
-        //TODO: implement real validation logic 
+    public IaasProvider validate(Partition partition, Properties properties) throws InvalidPartitionException
{
         return iaasProvider;
-       
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/KubernetesPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/KubernetesPartitionValidator.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/KubernetesPartitionValidator.java
index 8ecb7d9..5f189ee 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/KubernetesPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/KubernetesPartitionValidator.java
@@ -20,10 +20,12 @@ package org.apache.stratos.cloud.controller.iaases.validators;
 
 import java.util.Properties;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.cloud.controller.context.CloudControllerContext;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
+import org.apache.stratos.cloud.controller.domain.Partition;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.exception.NonExistingKubernetesClusterException;
 import org.apache.stratos.common.constants.StratosConstants;
@@ -45,26 +47,26 @@ public class KubernetesPartitionValidator implements PartitionValidator
{
     /**
      * Validate the given properties for its existent in this partition.
      * 
-     * @param partitionId partition id.
+     * @param partition partition.
      * @param properties set of properties to be validated.
      * @return cloned and modified {@link IaasProvider} which maps to the given partition.
      * @throws InvalidPartitionException if at least one property is evaluated to be invalid.
      */
-    public IaasProvider validate(String partitionId, Properties properties) throws InvalidPartitionException
{
+    public IaasProvider validate(Partition partition, Properties properties) throws InvalidPartitionException
{
 
-        if (properties.containsKey(StratosConstants.KUBERNETES_CLUSTER_ID)) {
-            String kubernetesClusterId = properties.getProperty(StratosConstants.KUBERNETES_CLUSTER_ID);
+        String kubernetesClusterId = partition.getKubernetesClusterId();
+        if (StringUtils.isNotBlank(kubernetesClusterId)) {
             try {
                 CloudControllerContext.getInstance().getKubernetesCluster(kubernetesClusterId);
                 return iaasProvider;
             } catch (NonExistingKubernetesClusterException e) {
-                String message = "Kubernetes partition is not valid: [partition-id] " + partitionId;
+                String message = "Kubernetes partition is not valid: [partition-id] " + partition.getId();
                 log.error(message, e);
                 throw new InvalidPartitionException(message, e);
             }
         }
 
-        String message = "Kubernetes partition is not valid: [partition-id] " + partitionId
+ ", property not found: "
+        String message = "Kubernetes partition is not valid: [partition-id] " + partition.getId()
+ ", property not found: "
                         + StratosConstants.KUBERNETES_CLUSTER_ID;
         log.error(message);
         throw new InvalidPartitionException(message);

http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java
index f2205b2..06fb509 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java
@@ -20,6 +20,7 @@ package org.apache.stratos.cloud.controller.iaases.validators;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.cloud.controller.domain.Partition;
 import org.apache.stratos.cloud.controller.exception.InvalidIaasProviderException;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
@@ -44,7 +45,7 @@ public class OpenstackNovaPartitionValidator implements PartitionValidator
{
     private Iaas iaas;
 
     @Override
-    public IaasProvider validate(String partitionId, Properties properties) throws InvalidPartitionException
{
+    public IaasProvider validate(Partition partition, Properties properties) throws InvalidPartitionException
{
         try {
             // validate the existence of the zone and hosts properties.
             if (properties.containsKey(Scope.region.toString())) {
@@ -52,9 +53,8 @@ public class OpenstackNovaPartitionValidator implements PartitionValidator
{
                 
                 if (iaasProvider.getImage() != null && !iaasProvider.getImage().contains(region))
{
 
-                    String msg =
-                                 "Invalid Partition Detected : " + partitionId +
-                                         " - Cause: Invalid Region: " + region;
+                    String msg = "Invalid partition detected, invalid region: [partition-id]
" + partition.getId() +
+                                         " [region] " + region;
                     log.error(msg);
                     throw new InvalidPartitionException(msg);
                 } 
@@ -75,17 +75,15 @@ public class OpenstackNovaPartitionValidator implements PartitionValidator
{
                 } 
                 
                 updateOtherProperties(updatedIaasProvider, properties);
-                
                 return updatedIaasProvider;
-                
             } else {
 
                 return iaasProvider;
             }
-        } catch (Exception ex) {
-            String msg = "Invalid Partition Detected : "+partitionId+". Cause: "+ex.getMessage();
-            log.error(msg, ex);
-            throw new InvalidPartitionException(msg, ex);
+        } catch (Exception e) {
+            String msg = "Invalid partition detected: [partition-id] " + partition.getId()
+ e.getMessage();
+            log.error(msg, e);
+            throw new InvalidPartitionException(msg, e);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/PartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/PartitionValidator.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/PartitionValidator.java
index 6bcbdcd..6a8810a 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/PartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/PartitionValidator.java
@@ -20,6 +20,7 @@ package org.apache.stratos.cloud.controller.iaases.validators;
 
 import java.util.Properties;
 
+import org.apache.stratos.cloud.controller.domain.Partition;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
 
@@ -38,10 +39,10 @@ public interface PartitionValidator {
     /**
      * Validate the given properties for its existent in this partition.
      * 
-     * @param partitionId partition id.
+     * @param partition partition.
      * @param properties set of properties to be validated.
      * @return cloned and modified {@link IaasProvider} which maps to the given partition.
      * @throws InvalidPartitionException if at least one property is evaluated to be invalid.
      */
-    public abstract IaasProvider validate(String partitionId, Properties properties) throws
InvalidPartitionException;
+    public abstract IaasProvider validate(Partition partition, Properties properties) throws
InvalidPartitionException;
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/VCloudPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/VCloudPartitionValidator.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/VCloudPartitionValidator.java
index 8af42d7..a6b9920 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/VCloudPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/VCloudPartitionValidator.java
@@ -22,6 +22,7 @@ import java.util.Properties;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.cloud.controller.domain.Partition;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
@@ -40,7 +41,7 @@ public class VCloudPartitionValidator implements PartitionValidator {
 	private Iaas iaas;
 
     @Override
-    public IaasProvider validate(String partitionId, Properties properties) throws InvalidPartitionException
{
+    public IaasProvider validate(Partition partition, Properties properties) throws InvalidPartitionException
{
         //TODO: implement real validation logic 
         return iaasProvider;
        

http://git-wip-us.apache.org/repos/asf/stratos/blob/3343cf74/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
index cc84cec..9534ad5 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
@@ -91,28 +91,24 @@ public class CloudControllerServiceUtil {
     
     public static IaasProvider validatePartitionAndGetIaasProvider(Partition partition, IaasProvider
iaasProvider) throws InvalidPartitionException {
         String provider = partition.getProvider();
-        String partitionId = partition.getId();
         Properties partitionProperties = CloudControllerUtil.toJavaUtilProperties(partition.getProperties());
 
         if (iaasProvider != null) {
             // if this is a IaaS based partition
             Iaas iaas = iaasProvider.getIaas();
-
             PartitionValidator validator = iaas.getPartitionValidator();
             validator.setIaasProvider(iaasProvider);
-            iaasProvider = validator.validate(partitionId, partitionProperties);
+            iaasProvider = validator.validate(partition, partitionProperties);
             return iaasProvider;
 
         } else if (CloudControllerConstants.DOCKER_PARTITION_PROVIDER.equals(provider)) {
             // if this is a docker based Partition
             KubernetesPartitionValidator validator = new KubernetesPartitionValidator();
-            validator.validate(partitionId, partitionProperties);
+            validator.validate(partition, partitionProperties);
             return null;
 
         } else {
-
-            String msg =
-                    "Invalid Partition - " + partition.toString() + ". Cause: Cannot identify
as a valid partition.";
+            String msg = "Invalid partition found: [partition-id] " + partition.getId();
             log.error(msg);
             throw new InvalidPartitionException(msg);
         }


Mime
View raw message