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 #6518: Correct the detection on change on nodes to prevent constan... #849

Conversation

ncharles
Copy link
Member

...t redeploy

) {
// We need a method to correctly compare a NodeConfigurationCache that was serialized
// from a NodeconfigurationCache created from a NodeConfiguration (so without writtenDate)
def equalWithoutWrittenDate(other: NodeConfigurationCache) : Boolean = {
Copy link
Member

Choose a reason for hiding this comment

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

NITPICKING time:

What do you think of the solutions from this thread ? (need @fanf eye on this too!)

http://stackoverflow.com/questions/10373715/scala-ignore-case-class-field-for-equals-hascode

I like the first solution (having case class NodeConfigurationCache(id : NodeId, nodeInfo : ...)(val writtenDate : ...) but it would prevent comparing on writtenDate when it is defined, so we may want to exclude this

Maybe rewriting equals and checking None cases would be better ?

Maybe we should have transform all our NodeConfigurationCache into NodeConfiguration and compare them instead of comparing NodeConfigurationCache ?

Copy link
Member

Choose a reason for hiding this comment

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

I think the best solution would be to transform NodeConfigCache into Nodeconfig and compare them to actual config with equals

@VinceMacBuche
Copy link
Member

This is a great imporvement! Thank you for finding this @ncharles !! Just a little question on its implementation

@fanf
Copy link
Member

fanf commented May 5, 2015

I double checked that updates in techniques are correctly reported, and it seems to be ok!
So, good for me :)

fanf added a commit that referenced this pull request May 5, 2015
…lways

Fixes #6518: Correct the detection on change on nodes to prevent redeploy each time
@fanf fanf merged commit b5311a2 into Normation:branches/rudder/2.11 May 5, 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
Development

Successfully merging this pull request may close these issues.

3 participants