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

Sort hosts before writing them to a file #42

Merged
merged 1 commit into from
Oct 19, 2017
Merged

Sort hosts before writing them to a file #42

merged 1 commit into from
Oct 19, 2017

Conversation

danielparks
Copy link
Contributor

The hosts might be generated in a non-deterministic order (e.g. from PuppetDB). If that's the case, then the configuration file they're written to will change every run.

This ensures that they are always written consistently and avoids spurious change reports.

The hosts might be generated in a non-deterministic order (e.g. from
PuppetDB). If that's the case, then the configuration file they're
written to will change every run.

This ensures that they are always written consistently and avoids
spurious change reports.
@@ -22,7 +22,7 @@
}

$config_hash = {
'hosts' => $hosts,
'hosts' => $hosts.sort(),
Copy link
Owner

Choose a reason for hiding this comment

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

Does this match the style guide or should it be sort($hosts)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see anything in the style guide about it. Happy to change it.

@npwalker npwalker merged commit 24928db into npwalker:master Oct 19, 2017
@danielparks danielparks deleted the sort-hosts branch October 19, 2017 01:47
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.

None yet

2 participants