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

Commit

Permalink
Issue #2295: renaming polices => techniques and linked names
Browse files Browse the repository at this point in the history
  • Loading branch information
fanf committed Feb 22, 2012
1 parent 58a6331 commit 1e29981
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
Expand Up @@ -200,7 +200,7 @@ case class NodeInventory(
hostedVmIds : Seq[(MachineUuid,InventoryStatus)] = Seq(),
softwareIds : Seq[SoftwareUuid] = Seq(),
accounts : Seq[String] = Seq(),
policies : Seq[String] = Seq(),
techniques : Seq[String] = Seq(),
serverIps : Seq[String] = Seq(),
networks: Seq[Network] = Seq(),
fileSystems:Seq[FileSystem] = Seq()
Expand Down
Expand Up @@ -206,15 +206,15 @@ object RudderAgentNameParsing extends FusionReportParsingExtension with Loggable


/**
* <POLICIES>
* <TECHNIQUES>
*/
object RudderPoliciesParsing extends FusionReportParsingExtension {
override def isDefinedAt(x:(Node,InventoryReport)) = { x._1.label == "POLICIES" }
object RudderTechniquesParsing extends FusionReportParsingExtension {
override def isDefinedAt(x:(Node,InventoryReport)) = { x._1.label == "TECHNIQUES" }
override def apply(x:(Node,InventoryReport)) : InventoryReport = {
x._2.copy( node = x._2.node.copy( policies = x._2.node.policies ++ processPolicies(x._1) ) )
x._2.copy( node = x._2.node.copy( techniques = x._2.node.techniques ++ processTechniques(x._1) ) )
}
def processPolicies(xml:NodeSeq) : Seq[String] = {
(xml \ "POLICY").flatMap(e => optText(e))
def processTechniques(xml:NodeSeq) : Seq[String] = {
(xml \ "TECHNIQUE").flatMap(e => optText(e))
}
}

Expand Down
Expand Up @@ -125,7 +125,7 @@ class AppConfig {
new RudderPublicKeyParsing(keyNorm) ::
RudderRootUserParsing ::
RudderAgentNameParsing ::
RudderPoliciesParsing ::
RudderTechniquesParsing ::
RudderHostnameParsing ::
Nil
)
Expand Down
6 changes: 3 additions & 3 deletions inventory-repository/src/main/resources/ldap/inventory.schema
Expand Up @@ -267,8 +267,8 @@ attributetype ( InventoryAttributes:300.8
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )

attributetype ( InventoryAttributes:300.9
NAME 'nodePolicies'
DESC 'Name of policies applied to that node'
NAME 'nodeTechniques'
DESC 'Name of techniques applied to that node'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
Expand Down Expand Up @@ -795,7 +795,7 @@ objectclass ( InventoryObjectClasses:14
policyServerId $ osName $ osVersion $ osKernelVersion )
MAY ( description $ cn $ publicKey $ agentName $ hostedVm $ container $
software $ localAccountName $ osServicePack $
nodePolicies $ ram $ swap $ confirmed $
nodeTechniques $ ram $ swap $ confirmed $
inventoryDate $ ipHostNumber $ osFullName $
osArchitectureType $ lastLoggedUser $ lastLoggedUserTime ) )

Expand Down
8 changes: 4 additions & 4 deletions inventory-repository/src/main/resources/ldap/slapd.conf
Expand Up @@ -18,14 +18,14 @@ loglevel none stats
# service AND an understanding of referrals.
#referral ldap://root.openldap.org

pidfile /var/rudder/run/slapd.pid
pidfile /var/rudder/run/slapd.pid
argsfile /var/rudder/run/slapd.args

# Load dynamic modules for backends and overlays:
modulepath /opt/rudder/libexec/openldap/
moduleload back_hdb.la
moduleload back_monitor.la
moduleload dynlist.la
moduleload dynlist.la

# Sample security restrictions
# Require integrity protection (prevent hijacking)
Expand Down Expand Up @@ -81,8 +81,8 @@ checkpoint 128 1

# Indices to maintain
index objectClass eq
index isActivated,isDynamic,isModified eq
index referencePolicyTemplateId,nodeGroupId,userPolicyTemplateId,policyInstanceId,softwareId,policyCategoryId eq
index isEnabled,isDynamic,isModified eq
index ruleId,techniqueId,nodeGroupId,activeTechniqueId,directiveId,softwareId,techniqueCategoryId eq
index machineId,nodeId eq
index container,software eq

Expand Down
Expand Up @@ -618,7 +618,7 @@ class InventoryMapper(
}:_*)

root +=! (A_ACCOUNT, server.accounts:_*)
root +=! (A_NODE_POLICIES, server.policies:_*)
root +=! (A_NODE_TECHNIQUES, server.techniques:_*)
root +=! (A_LIST_OF_IP, server.serverIps:_*)

val tree = LDAPTree(root)
Expand Down Expand Up @@ -755,7 +755,7 @@ class InventoryMapper(
hostedVmIds = mapSeqStringToMachineIdAndStatus(entry.valuesFor(A_HOSTED_VM_DN))
inventoryDate = entry.getAsGTime(A_INVENTORY_DATE).map { _.dateTime }
accounts = entry.valuesFor(A_ACCOUNT).toSeq
policies = entry.valuesFor(A_NODE_POLICIES).toSeq
techniques = entry.valuesFor(A_NODE_TECHNIQUES).toSeq
serverIps = entry.valuesFor(A_LIST_OF_IP).toSeq
} yield {
NodeInventory(
Expand All @@ -773,7 +773,7 @@ class InventoryMapper(
hostedVmIds,
softwareIds,
accounts,
policies,
techniques,
serverIps,
networks = Nil,
fileSystems = Nil
Expand Down
Expand Up @@ -72,7 +72,7 @@ object LDAPConstants {
val A_OS_RAM = "ram"
val A_OS_SWAP = "swap"
val A_ACCOUNT = "localAccountName"
val A_NODE_POLICIES = "nodePolicies"
val A_NODE_TECHNIQUES = "nodeTechniques"
val A_INVENTORY_DATE = "inventoryDate"

val A_LIST_OF_IP = "ipHostNumber"
Expand Down Expand Up @@ -293,7 +293,7 @@ object LDAPConstants {
must = Set(A_NODE_UUID, A_OS_NAME, A_OS_FULL_NAME, A_OS_VERSION, A_OS_KERNEL_VERSION),
may = Set(A_NAME,A_DESCRIPTION,A_PKEYS,A_AGENTS_NAME,A_HOSTED_VM_DN,
A_CONTAINER_DN,A_SOFTWARE_DN,A_ACCOUNT,A_ROOT_USER,A_ARCH, A_LAST_LOGGED_USER, A_LAST_LOGGED_USER_TIME,
A_HOSTNAME,A_NODE_POLICIES,A_OS_RAM,A_OS_SWAP, A_LIST_OF_IP, A_OS_SERVICE_PACK) )
A_HOSTNAME,A_NODE_TECHNIQUES,A_OS_RAM,A_OS_SWAP, A_LIST_OF_IP, A_OS_SERVICE_PACK) )

OC +=(OC_WINDOWS_NODE, sup = OC(OC_NODE),
may = Set(A_WIN_USER_DOMAIN,A_WIN_COMPANY,A_WIN_KEY,A_WIN_ID) )
Expand Down Expand Up @@ -337,7 +337,7 @@ object LDAPConstants {
// User defined properties : the regexp that the data should abide by
val userDefinedPropertyRegex = """\{([^\}]+)\}(.+)""".r

// Policy bindings variable regexp : VariableName:FieldName
// variable bindings variable regexp : VariableName:FieldName
val variableBindingRegex = """(.+):(.+)""".r

}

0 comments on commit 1e29981

Please sign in to comment.