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

Fix ordering of options changing #69

Merged
merged 1 commit into from
May 30, 2014
Merged

Conversation

lboynton
Copy link

The order of the options kept changing on each puppet run for me. Adding the sort makes the order consistent on each puppet run.

The order of the options kept changing on each puppet run for me. Adding the sort makes the order consistent on each puppet run.
@blkperl
Copy link

blkperl commented Mar 28, 2014

👍 Looks good

hunner added a commit that referenced this pull request May 30, 2014
Fix ordering of options changing
@hunner hunner merged commit a4f8f2a into puppetlabs:master May 30, 2014
@greg0ire
Copy link

Please revert this. I think the order must the one specified in the defined type. See here why. Maybe another solution could be found to make sure this order is preserved?

@lboynton
Copy link
Author

The problem with simply reverting the change is that the order can change each time puppet runs, thus resulting in the same warning occurring, albeit not every time. What other options are there for fixing the order?

@lboynton lboynton deleted the patch-1 branch September 11, 2014 12:29
@greg0ire
Copy link

@lboynton : you are right, before reverting this, the underlying bug (having the order change sometimes) should be fixed. Why does it even change? And, more importantly, did you report that bug somewhere?

@greg0ire
Copy link

@lboynton : I think I found a bug report about this (since options are passed with a hash). I'm using ruby 1.9, what are you using (or rather, were you using at the time)?

@greg0ire
Copy link

ping @lboynton

@greg0ire
Copy link

@hunner : any comment on this ? Could you revert this ?

@lboynton
Copy link
Author

I was using Ruby 1.8.7, since that is the default with CentOS 6. According to that bug report, there is no fix for Ruby 1.8?

@igalic
Copy link

igalic commented Sep 15, 2014

i don't get why this is necessary. both ports and options are arrays, they should be presorted/not change their sort-order. regardless of ruby version.

@greg0ire
Copy link

@igalic : you can find an explanation in the bug report I linked previously.
@lboynton : thanks for your answer, and no, there seems to be no fix for Ruby 1.8, and it says the hashes happen to have their sort order preserved in 1.9, but this is not a requirement of the language spec, which means using hashes in puppet is… bug-based. What should be done is something ugly, like in concat (using an "order") :

[
   {'key' => 'use_backend', 'value' => 'some_value', 'order'=> 1},
   {'key' => 'use_backend', 'value' => 'some_value', 'order'=> 2}
]

It would be more sensible IMO to stay "bug-based", but remove the sort so that 1.9 users get the order they choose.

cegeka-jenkins pushed a commit to cegeka/puppet-haproxy that referenced this pull request Dec 19, 2017
Fix ordering of options changing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants