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 #6454: networks.conf empty on relay #839

Conversation

VinceMacBuche
Copy link
Member

@VinceMacBuche
Copy link
Member Author

Something need to be done for the "policy_server" class too, but it should be done in another issue I think

//scenario lead to the removal (or non addition) of them
nodes ++ allNodes.collect { case(k,n) if(n._2.size>0 || n._1 == Constants.ROOT_POLICY_SERVER_ID) => k }
// all nodes with server roles or policyServer (ie relay)
nodes ++ allNodes.collect { case(k,n) if(n._2.size>0 || n._1) => k }
Copy link
Member

Choose a reason for hiding this comment

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

If I understand correctly, you are always adding k in the node; for there always is a n._1
this looks plain wrong

Copy link
Member Author

Choose a reason for hiding this comment

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

N._1 is a boolean meaning that the node is a policyServer ( either the root server or a relay)

Maybe I should explicit the tuple here by having ( nodeId, ( isPolicyServer, server roles)) inster of (k,n)

The code before was completely wrong ( comparing a boolean and a string)

Copy link
Member

Choose a reason for hiding this comment

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

ho, so it was before in another file ( see PR https://github.com/Normation/rudder/pull/824/files ) and that broke it.

@VinceMacBuche
Copy link
Member Author

PR updated

@VinceMacBuche VinceMacBuche force-pushed the bug_6454/networks_conf_empty_on_relay branch from 371f9ff to 8280b13 Compare April 2, 2015 09:37
nodes ++ allNodes.collect {
case (nodeId,(isPolicyServer, roles))
if isANodeWithRole(nodeId,isPolicyServer,roles)
=> nodeId
Copy link
Member

Choose a reason for hiding this comment

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

please, please, can you use enclosing { }  ?

@VinceMacBuche VinceMacBuche force-pushed the bug_6454/networks_conf_empty_on_relay branch from 8280b13 to 6445303 Compare April 2, 2015 10:10
@VinceMacBuche
Copy link
Member Author

PR updated

ncharles added a commit that referenced this pull request Apr 2, 2015
…ty_on_relay

Fixes #6454: networks.conf empty on relay
@ncharles ncharles merged commit b57a0f6 into Normation:branches/rudder/2.11 Apr 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants