Commit 16dfefa2 authored by Marta Różańska's avatar Marta Różańska
Browse files

Merge branch 'fix/check_only_iaas_nc_update_finished' into 'proactive-dev'

change to check if IAAS nodes are already collected by SAL (BYON nodes are not of our interest here)

See merge request !25
parents 71593047 a6f4d0cb
Pipeline #15610 passed with stages
in 33 minutes and 2 seconds
...@@ -4,6 +4,8 @@ import cloud.morphemic.connectors.proactive.ProactiveClientServiceConnector; ...@@ -4,6 +4,8 @@ import cloud.morphemic.connectors.proactive.ProactiveClientServiceConnector;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
import org.activeeon.morphemic.PAGateway; import org.activeeon.morphemic.PAGateway;
import org.activeeon.morphemic.model.NodeCandidate; import org.activeeon.morphemic.model.NodeCandidate;
import org.activeeon.morphemic.model.NodeType;
import org.activeeon.morphemic.model.NodeTypeRequirement;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
...@@ -11,10 +13,7 @@ import org.mule.api.annotations.param.Payload; ...@@ -11,10 +13,7 @@ import org.mule.api.annotations.param.Payload;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.LinkedHashMap; import java.util.*;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
public class ProactiveClientServiceForIntegrationImpl extends ProactiveClientServiceConnector implements ProactiveClientServiceForIntegration { public class ProactiveClientServiceForIntegrationImpl extends ProactiveClientServiceConnector implements ProactiveClientServiceForIntegration {
private static final Logger log = LoggerFactory.getLogger(ProactiveClientServiceForIntegrationImpl.class); private static final Logger log = LoggerFactory.getLogger(ProactiveClientServiceForIntegrationImpl.class);
...@@ -108,7 +107,10 @@ public class ProactiveClientServiceForIntegrationImpl extends ProactiveClientSer ...@@ -108,7 +107,10 @@ public class ProactiveClientServiceForIntegrationImpl extends ProactiveClientSer
log.info("ProactiveClientServiceForIntegrationImpl->checkNodeCandidatesUpdateFinished: starting..."); log.info("ProactiveClientServiceForIntegrationImpl->checkNodeCandidatesUpdateFinished: starting...");
Optional<PAGateway> paGatewayOptional = getPAGateway(); Optional<PAGateway> paGatewayOptional = getPAGateway();
if(paGatewayOptional.isPresent()) { if(paGatewayOptional.isPresent()) {
List<NodeCandidate> nodeCandidates = paGatewayOptional.get().findNodeCandidates(null); NodeTypeRequirement nodeTypeRequirement = new NodeTypeRequirement();
nodeTypeRequirement.setNodeTypes(Collections.singletonList(NodeType.IAAS));
log.info("ProactiveClientServiceForIntegrationImpl->checkNodeCandidatesUpdateFinished: checking only for occurrence of IAAS nodeCandidates, passing requirement: {}", nodeTypeRequirement);
List<NodeCandidate> nodeCandidates = paGatewayOptional.get().findNodeCandidates(Collections.singletonList(nodeTypeRequirement));
log.info("ProactiveClientServiceForIntegrationImpl->checkNodeCandidatesUpdateFinished: nodeCandidates size= {}", nodeCandidates.size()); log.info("ProactiveClientServiceForIntegrationImpl->checkNodeCandidatesUpdateFinished: nodeCandidates size= {}", nodeCandidates.size());
if (nodeCandidates.isEmpty()) { if (nodeCandidates.isEmpty()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment