You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2015/06/18 06:47:04 UTC
[2/2] stratos git commit: Changing logic to validate network
partitions in deployment policy deployment
Changing logic to validate network partitions in deployment policy deployment
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/4e97b3e5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/4e97b3e5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/4e97b3e5
Branch: refs/heads/master
Commit: 4e97b3e5067086da937fce7fe01dc9fb9badcbcc
Parents: 0035407
Author: lasinducharith <la...@gmail.com>
Authored: Thu Jun 18 10:16:05 2015 +0530
Committer: lasinducharith <la...@gmail.com>
Committed: Thu Jun 18 10:16:05 2015 +0530
----------------------------------------------------------------------
.../services/impl/AutoscalerServiceImpl.java | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/4e97b3e5/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index c2ee635..4e324fc 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@ -1054,16 +1054,20 @@ public class AutoscalerServiceImpl implements AutoscalerService {
// network partition - partition id should be already added
for (PartitionRef partitionRef : networkPartitionRef.getPartitionRefs()) {
String partitionId = partitionRef.getId();
+ boolean isPartitionFound = false;
for (Partition partition : networkPartition.getPartitions()) {
- if (!partition.getId().equals(partitionId)) {
- String msg = String.format("Partition Id is not found: [deployment-policy-id] %s " +
- "[network-partition-id] %s [partition-id] %s",
- deploymentPolicyId, networkPartitionId, partitionId);
- log.error(msg);
- throw new InvalidDeploymentPolicyException(msg);
+ if (partition.getId().equals(partitionId)) {
+ isPartitionFound = true;
}
}
+ if (isPartitionFound == false) {
+ String msg = String.format("Partition Id is not found: [deployment-policy-id] %s " +
+ "[network-partition-id] %s [partition-id] %s",
+ deploymentPolicyId, networkPartitionId, partitionId);
+ log.error(msg);
+ throw new InvalidDeploymentPolicyException(msg);
+ }
}
// partition algorithm can't be null or empty