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 #4292: Make the CFEngine port in ncf configurable #22

Conversation

Kegeruneku
Copy link

Ticket: http://www.rudder-project.org/redmine/issues/4292

To be merged in master

@jooooooon
Copy link
Member

This looks good in principle but I disagree with the approach partially.

ncf is about making cfengine easy. But having to pass the port number in each body call is a unnecessary effort put on the user. I would prefer to have the ncf body just use the port number from the global config directly. This would be simpler for users and less error prone, also trivial to implement.

Aside from that your copy_from body doesn't actually use it's port parameter, so this won't actually work as is.

No other problems I see though. Good work on adding clear comments.

@Kegeruneku
Copy link
Author

I agree with the wrong definition of the body, not using the declared port at all.

However, I don't get the other remarks. The user have NOTHING to do with the port name, and will not even have to see it. It is given by the configuration and editable if needed with sensible defaults, that's all that he will even need to see.

@Kegeruneku
Copy link
Author

As you can see in file_copy_from_remote_source_recursion, the port is only used in this bundle and get from the configuration and not from the bundle arguments.

@jooooooon
Copy link
Member

I'm suggesting you go one step further: never pass the port number. Your body would therefore look like this:

body copy_from ncf_remote_cp_port_method(from,server,method)
{
  servers     => { "$(server)" };
  source      => "$(from)";
  portnumber  => "${configuration.cfengine_port}";
  compare     => "${method}";
}

I don't see any reason for this not to be the case - the only valid reason for using a parameter to the body is to make the portnumber configurable, but by having it in ncf.conf, it is already configurable.

If you disagree, can you please explain what advantage(s) your approach has over the one I suggest here?

@Kegeruneku
Copy link
Author

This approach is cleaner, I'll do it!

@Kegeruneku
Copy link
Author

The only setback I see here is that it "violates" a bit the idea of having self contained and independant bodies

@Kegeruneku
Copy link
Author

Corrected !

VinceMacBuche added a commit that referenced this pull request Dec 31, 2013
…ngine_data_transfer_port_configurable

Fixes #4292: Make the CFEngine port in ncf configurable
@VinceMacBuche VinceMacBuche merged commit ab227c9 into Normation:master Dec 31, 2013
@VinceMacBuche
Copy link
Member

Merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants