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
Conversation
PR rebased |
1c6461e
to
4cd6ab3
Compare
PR rebased |
4cd6ab3
to
a37c213
Compare
PR rebased |
a37c213
to
8323367
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}"}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's clever!
@@ -144,14 +143,14 @@ object NodeConfigurationHash { | |||
*/ | |||
val nodeInfoHashValue = { | |||
val i = nodeConfig.nodeInfo | |||
List( | |||
List[Int]( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a real interest to use hashcode for boolean to be hashcoded ? (except for consistency purpose?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAI recall, I had a warning by the compiler if not doing so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
<TECHNIQUE name="DSC Agant"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DSC Agent
8323367
to
bc8f6cf
Compare
PR rebased |
1 similar comment
PR rebased |
bc8f6cf
to
582bc11
Compare
@@ -231,7 +241,7 @@ class WriteSystemTechniquesTest extends Specification with Loggable with BoxSpec | |||
|
|||
//////////// set-up auto test cleaning //////////// | |||
override def afterAll(): Unit = { | |||
if(System.getProperty("tests.clean.tmp") != "false") { | |||
if(false) { // System.getProperty("tests.clean.tmp") != "false") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you forgot this one
…based on agent type
PR rebased |
582bc11
to
5426084
Compare
OK, merging this PR |
https://www.rudder-project.org/redmine/issues/10823
This add the notion of AgentType
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