Skip to content
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 #11168: Search believe that CFEngine agents with "dsc" in their keys are also DSC agent #1752

Conversation

VinceMacBuche
Copy link
Member

@VinceMacBuche VinceMacBuche force-pushed the bug_11168/search_believe_that_cfengine_agents_with_dsc_in_their_keys_are_also_dsc_agent branch from be3fb12 to 9efb220 Compare October 4, 2017 15:26
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_11168/search_believe_that_cfengine_agents_with_dsc_in_their_keys_are_also_dsc_agent branch from 9efb220 to 099b132 Compare October 5, 2017 14:18
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_11168/search_believe_that_cfengine_agents_with_dsc_in_their_keys_are_also_dsc_agent branch from 099b132 to 4505038 Compare October 9, 2017 14:53
@VinceMacBuche
Copy link
Member Author

Commit modified

@ncharles
Copy link
Member

ncharles commented Oct 9, 2017

could you add a test with the offending key, to ensure correct behaviour ?


val agentMap = AgentType.allValues.toList.map(a => (a.id, a :: Nil)).toMap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you didn't do what you intented here: agentMap does not contain ANY_CFENGINE, I believe you wanted to do something like:

  • delete agentTypes
  • val agentMap = ( (ANY_CFENGINE, "Any CFEngine based agent") :: AgentType.allValues.toList.map(a => (a.id, a :: Nil))).toMap

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was on first version then eclipse havoc ... adding it back

@VinceMacBuche VinceMacBuche force-pushed the bug_11168/search_believe_that_cfengine_agents_with_dsc_in_their_keys_are_also_dsc_agent branch from 4505038 to 96a056b Compare October 10, 2017 10:05
@VinceMacBuche
Copy link
Member Author

Commit modified

Copy link
Member

@fanf fanf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a test ? I don't remember how hard it is to do so, though.

private[this] def filterAgent(agent: String) = SUB(A_AGENTS_NAME, null, Array(agent), null)
private[this] def filterAgent(agent: AgentType) =
SUB(A_AGENTS_NAME, null, Array(s""""agentType":"${agent.id}""""), null) ::
EQ(A_AGENTS_NAME, agent.oldShortName) ::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment here so that we remember why we need to keep old short name here?

@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_11168/search_believe_that_cfengine_agents_with_dsc_in_their_keys_are_also_dsc_agent branch from 96a056b to c9657a4 Compare October 10, 2017 23:26
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_11168/search_believe_that_cfengine_agents_with_dsc_in_their_keys_are_also_dsc_agent branch from c9657a4 to bd64dbe Compare October 11, 2017 10:34
@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit bd64dbe into Normation:branches/rudder/4.2 Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants