New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #10823: Select system techniques and generate correct policies based on agent type #1667

Merged
merged 1 commit into from Jun 19, 2017

Conversation

Projects
None yet
3 participants
@fanf
Member

fanf commented Jun 15, 2017

https://www.rudder-project.org/redmine/issues/10823

This add the notion of AgentType

  • in the technique metadata.xml (parse and add structure AgentConfig which holds Bundle, Files and Templates (with a default behavior to handle the case were is not present, default-ing to cfengine-community + cfengine-nova)
  • in the generation, and especially in the Bundle generation.

We also add then new AgentSpecificLogic.scala which holds how bundle and files for agent, and is ready to be extensible and plugable.
There is also some renaming (node -> xml in parsing for ex, to keep reader sanity, or Cf3PromisesFileWriterService -> PolicyWriterService)

Must be merged before #1670 and #1669

@fanf

This comment has been minimized.

Show comment
Hide comment
@fanf

fanf Jun 15, 2017

Member

PR rebased

Member

fanf commented Jun 15, 2017

PR rebased

@fanf

This comment has been minimized.

Show comment
Hide comment
@fanf

fanf Jun 16, 2017

Member

PR rebased

Member

fanf commented Jun 16, 2017

PR rebased

@fanf

This comment has been minimized.

Show comment
Hide comment
@fanf

fanf Jun 16, 2017

Member

PR rebased

Member

fanf commented Jun 16, 2017

PR rebased

@ncharles

Two tests are failing:

Failed tests: The technique described should::have bundle list: 'bundle1,bundle2'(com.normation.cfclerk.domain.TechniqueTest): List(bundle1, bundle2, bundle1, bundle2) is not equal to List(bundle1, bundle2) / expected:<bundle1(..)
The technique described should::have templates 'tml1, tml2, tml3'(com.normation.cfclerk.domain.TechniqueTest): List(tml1, tml2, tml3, tml1, tml2, tml3) is not equal to List(tml1, tml2, tml3) / expected:<tml1(..)

if (node.label.toUpperCase == TECHNIQUE_ROOT) {
node.attribute(TECHNIQUE_NAME) match {
def parseXml(xml: Node, id: TechniqueId, expectedReportCsvExists: Boolean): Technique = {
//check that xml is <TECHNIQUE> and has a name attribute

This comment has been minimized.

@ncharles

ncharles Jun 19, 2017

Member

this makes it much more readable, thank you !

@ncharles

ncharles Jun 19, 2017

Member

this makes it much more readable, thank you !

{
//for compability reason, we cheat and make the template/file/bundlesequence under root
//and not in an <AGENT> sub-element be considered as being in <AGENT type="cfengine-community,cfengine-enterprise">
val forCompatibilityAgent = <AGENT type={s"${AgentType.CfeCommunity.toString},${AgentType.CfeEnterprise.toString}"}>

This comment has been minimized.

@ncharles

ncharles Jun 19, 2017

Member

that's clever!

@ncharles

ncharles Jun 19, 2017

Member

that's clever!

@@ -144,14 +143,14 @@ object NodeConfigurationHash {
*/
val nodeInfoHashValue = {
val i = nodeConfig.nodeInfo
List(
List[Int](

This comment has been minimized.

@ncharles

ncharles Jun 19, 2017

Member

is there a real interest to use hashcode for boolean to be hashcoded ? (except for consistency purpose?)

@ncharles

ncharles Jun 19, 2017

Member

is there a real interest to use hashcode for boolean to be hashcoded ? (except for consistency purpose?)

This comment has been minimized.

@fanf

fanf Jun 19, 2017

Member

AFAI recall, I had a warning by the compiler if not doing so

@fanf

fanf Jun 19, 2017

Member

AFAI recall, I had a warning by the compiler if not doing so

This comment has been minimized.

@ncharles

ncharles Jun 19, 2017

Member

ok, thanks

@ncharles

ncharles Jun 19, 2017

Member

ok, thanks

Show outdated Hide outdated ...configuration-repository/techniques/dsc-agent/dsc-agent/1.0/metadata.xml
@fanf

This comment has been minimized.

Show comment
Hide comment
@fanf

fanf Jun 19, 2017

Member

PR rebased

Member

fanf commented Jun 19, 2017

PR rebased

@fanf

This comment has been minimized.

Show comment
Hide comment
@fanf

fanf Jun 19, 2017

Member

PR rebased

Member

fanf commented Jun 19, 2017

PR rebased

@fanf

This comment has been minimized.

Show comment
Hide comment
@fanf

fanf Jun 19, 2017

Member

PR rebased

Member

fanf commented Jun 19, 2017

PR rebased

@Normation-Quality-Assistant

This comment has been minimized.

Show comment
Hide comment
@Normation-Quality-Assistant

Normation-Quality-Assistant commented Jun 19, 2017

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit 5426084 into Normation:prototype/windows-dsc Jun 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment