Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Ref #3155 : Add android support in inventory processor #7

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,19 @@ object LinuxType {
:: Centos
:: Fedora
:: Suse
:: Android
:: Nil
)
}

case object UnknownLinuxType extends LinuxType with HashcodeCaching { val name = "Linux" }
case object Debian extends LinuxType with HashcodeCaching { val name = "Debian" }
case object Ubuntu extends LinuxType with HashcodeCaching { val name = "Ubuntu" }
case object Redhat extends LinuxType with HashcodeCaching { val name = "Redhat" }
case object Centos extends LinuxType with HashcodeCaching { val name = "Centos" }
case object Fedora extends LinuxType with HashcodeCaching { val name = "Fedora" }
case object Suse extends LinuxType with HashcodeCaching { val name = "Suse" }
case object UnknownLinuxType extends LinuxType with HashcodeCaching { val name = "Linux" }
case object Debian extends LinuxType with HashcodeCaching { val name = "Debian" }
case object Ubuntu extends LinuxType with HashcodeCaching { val name = "Ubuntu" }
case object Redhat extends LinuxType with HashcodeCaching { val name = "Redhat" }
case object Centos extends LinuxType with HashcodeCaching { val name = "Centos" }
case object Fedora extends LinuxType with HashcodeCaching { val name = "Fedora" }
case object Suse extends LinuxType with HashcodeCaching { val name = "Suse" }
case object Android extends LinuxType with HashcodeCaching { val name = "Android" }

/**
* The different OS type. For now, we know
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,14 @@ class FusionReportUnmarshaller(
else UnknownWindowsType

case ("linux" , x ) =>
if (x contains "debian") Debian
else if(x contains "ubuntu") Ubuntu
else if(x contains "redhat") Redhat
else if(x contains "centos") Centos
else if(x contains "fedora") Fedora
else if(x contains "suse" ) Suse
else UnknownLinuxType
//be sure to handle the validity of that case further down the processing pipeline,
//for example in PostUnMarshallCheckConsistency
if (x contains "debian" ) Debian
else if(x contains "ubuntu" ) Ubuntu
else if(x contains "redhat" ) Redhat
else if(x contains "centos" ) Centos
else if(x contains "fedora" ) Fedora
else if(x contains "suse" ) Suse
else if(x contains "android") Android
else UnknownOSType
case _ => UnknownOSType
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,13 +634,14 @@ class InventoryMapper(
case Linux(os,osFullName,osVersion,osServicePack,kernelVersion) =>
val linux = dit.NODES.NODE.linuxModel(server.main.id)
os match {
case Debian => linux += (A_OS_NAME, A_OS_DEBIAN)
case Ubuntu => linux += (A_OS_NAME, A_OS_UBUNTU)
case Redhat => linux += (A_OS_NAME, A_OS_REDHAT)
case Centos => linux += (A_OS_NAME, A_OS_CENTOS)
case Fedora => linux += (A_OS_NAME, A_OS_FEDORA)
case Suse => linux += (A_OS_NAME, A_OS_SUZE)
case _ => linux += (A_OS_NAME, A_OS_UNKNOWN_LINUX)
case Debian => linux += (A_OS_NAME, A_OS_DEBIAN)
case Ubuntu => linux += (A_OS_NAME, A_OS_UBUNTU)
case Redhat => linux += (A_OS_NAME, A_OS_REDHAT)
case Centos => linux += (A_OS_NAME, A_OS_CENTOS)
case Fedora => linux += (A_OS_NAME, A_OS_FEDORA)
case Suse => linux += (A_OS_NAME, A_OS_SUZE)
case Android => linux += (A_OS_NAME, A_OS_ANDROID)
case _ => linux += (A_OS_NAME, A_OS_UNKNOWN_LINUX)
}
linux

Expand Down Expand Up @@ -787,13 +788,14 @@ class InventoryMapper(

} else if(entry.isA(OC_LINUX_NODE)) {
val os = osName match {
case A_OS_DEBIAN => Debian
case A_OS_UBUNTU => Ubuntu
case A_OS_REDHAT => Redhat
case A_OS_CENTOS => Centos
case A_OS_FEDORA => Fedora
case A_OS_SUZE => Suse
case _ => UnknownLinuxType
case A_OS_DEBIAN => Debian
case A_OS_UBUNTU => Ubuntu
case A_OS_REDHAT => Redhat
case A_OS_CENTOS => Centos
case A_OS_FEDORA => Fedora
case A_OS_SUZE => Suse
case A_OS_ANDROID => Android
case _ => UnknownLinuxType
}
Full(Linux(os,osFullName,osVersion,osServicePack,kernelVersion))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ object LDAPConstants {
val A_OS_CENTOS = "Centos"
val A_OS_FEDORA = "Fedora"
val A_OS_SUZE = "Suse"
val A_OS_ANDROID = "Android"

/*
* A bunch of name, just to be sur to use variable
Expand Down