Revision f8f5fb90
Added by Vincent MEMBRÉ over 6 years ago
inventory-api/src/main/scala/com/normation/inventory/domain/AgentTypes.scala | ||
---|---|---|
|
||
import net.liftweb.common._
|
||
|
||
|
||
/**
|
||
* The enumeration holding the values for the agent
|
||
*/
|
inventory-fusion/src/main/scala/com/normation/inventory/provisioning/fusion/FusionReportUnmarshaller.scala | ||
---|---|---|
|
||
// as a temporary solution, we are getting information from packages
|
||
|
||
def findAgent(software: Seq[Software], agentType: AgentType) = (
|
||
software.find(p => p.name.getOrElse("")
|
||
.toLowerCase.contains(agentType.inventorySoftwareName ))
|
||
.flatMap(s => s.version.map(v => AgentVersion(agentType.toAgentVersionName(v.value))))
|
||
)
|
||
def findAgent(software: Seq[Software], agentType: AgentType) = {
|
||
val agentSoftName = agentType.inventorySoftwareName.toLowerCase()
|
||
for {
|
||
soft <- software.find{_.name.map(_.toLowerCase() contains agentSoftName).getOrElse(false)}
|
||
version <- soft.version
|
||
} yield {
|
||
AgentVersion(agentType.toAgentVersionName(version.value))
|
||
}
|
||
}
|
||
|
||
(xml \\ "RUDDER").headOption match {
|
||
case Some(rudder) =>
|
Also available in: Unified diff
Fixes #11396: Unkown agent version in Windows node details