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

r10k.yaml is rebuilt (md5sum differs) every Puppet run on ruby 1.8.7 #25

Closed
brasey opened this issue Jan 9, 2014 · 11 comments
Closed

Comments

@brasey
Copy link

brasey commented Jan 9, 2014

Looks like the contents of r10k.sources are just printing out in random order. One Puppet run will put sources: before basedir:, and the next will reverse it.

Would sorting the hash first keep this from happening?

@acidprime
Copy link
Collaborator

I am assuming you are on ruby 1.8.7?

@brasey
Copy link
Author

brasey commented Feb 20, 2014

It is:
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

Time to upgrade?

@Sharpie
Copy link

Sharpie commented Mar 10, 2014

In Ruby 1.8.7, the order of hash contents is not deterministic and may change between runs --- this results in YAML output with different orderings. In Ruby 1.9.3 and newer, hashes are deterministic with respect to the order in which keys are added to the hash.

@brasey
Copy link
Author

brasey commented Mar 10, 2014

Thanks for the explanation.

@Sharpie
Copy link

Sharpie commented Mar 10, 2014

And to actually answer your original question: yes, sorting the hash prior to output should ensure a fixed order.

@acidprime acidprime changed the title r10k.yaml is rebuilt (md5sum differs) every Puppet run r10k.yaml is rebuilt (md5sum differs) every Puppet run on ruby 1.8.7 Apr 4, 2014
@ghoneycutt
Copy link
Member

@acidprime This affects EL 6 which uses ruby v1.8.7. Since this module supports ruby v1.8.7 could you please take a look at this?

@tfhartmann
Copy link
Contributor

👍

@Sharpie
Copy link

Sharpie commented May 13, 2014

Given that PE 3 runs on Ruby 1.9.3, getting this fixed on 1.8.x might have to fight its way up the TODO list. Anyone feel like submitting a pull request?

@tfhartmann
Copy link
Contributor

I'd be willing to take a swing at it..

@ghoneycutt
Copy link
Member

@tfhartmann you're my hero

@acidprime
Copy link
Collaborator

closing , will reopen if #44 causes issues

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

No branches or pull requests

5 participants