Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import com.normation.cfclerk.domain.ReportingLogic.FocusReport
import com.normation.cfclerk.domain.SectionSpec
import com.normation.cfclerk.domain.TechniqueName
import com.normation.errors.*
import com.normation.inventory.domain.AgentType
import com.normation.inventory.domain.MemorySize
import com.normation.inventory.domain.NodeId
import com.normation.rudder.batch.UpdateDynamicGroups
Expand Down Expand Up @@ -843,7 +844,11 @@ object GetConsistentNodesAndGroups {
PolicyServerConfigurationObjects.extractPolicyServerIdFromHasGroupName(nodeGroup.id) match {
// retrieve from the list of NodeFact
case Some(policyServerId) =>
nodeFacts.collect { case (id, nf) if (nf.rudderSettings.policyServerId == policyServerId) => id }.toSet
nodeFacts.collect {
case (id, nf)
if (nf.rudderSettings.policyServerId == policyServerId && nf.rudderAgent.agentType == AgentType.CfeCommunity) =>
id
}.toSet
case None =>
nodeGroup.serverList
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

package com.normation.rudder.services.policies

import com.normation.inventory.domain.AgentType
import com.normation.inventory.domain.NodeId
import com.normation.rudder.domain.nodes.NodeGroup
import com.normation.rudder.domain.nodes.NodeGroupCategoryId
Expand Down Expand Up @@ -85,9 +86,14 @@ class TestGetConsistentNodesAndGroups extends Specification {

private val node3Id = NodeId("node3")
private val fact4 = fact1.modify(_.id).setTo(NodeId("node4")).modify(_.rudderSettings.state).setTo(NodeState.Ignored)
private val fact5 = fact1
.modify(_.id)
.setTo(NodeId("node5"))
.modify(_.rudderAgent)
.setTo(fact1.rudderAgent.modify(_.agentType).setTo(AgentType.Dsc))

// our map of currently known nodes
private val allNodes = List(factRoot, fact1, fact2, fact4).map(n => n.id -> n).toMap.view
private val allNodes = List(factRoot, fact1, fact2, fact4, fact5).map(n => n.id -> n).toMap.view

// for a user group, we can't know that there is an inconsistency without recomputing the dynamic group,
// so for this one, we don't know if it should have node2 or not.
Expand Down