diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-05-23 15:06:02 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-05-23 15:06:02 +0000 |
commit | fb6f9b67ca4bf82b22fc9ec469b9b6beeb08c0a2 (patch) | |
tree | 1c70be9551a91c87bce98bcbc19244022c80f48c /modules/buildsystem/templates/iurt.conf | |
parent | 03f72e194890b250aa7462ca2b763adc9e4b06ff (diff) | |
download | puppet-fb6f9b67ca4bf82b22fc9ec469b9b6beeb08c0a2.tar puppet-fb6f9b67ca4bf82b22fc9ec469b9b6beeb08c0a2.tar.gz puppet-fb6f9b67ca4bf82b22fc9ec469b9b6beeb08c0a2.tar.bz2 puppet-fb6f9b67ca4bf82b22fc9ec469b9b6beeb08c0a2.tar.xz puppet-fb6f9b67ca4bf82b22fc9ec469b9b6beeb08c0a2.zip |
buildsystem: remove use of .each on hashes
Remove use of "each" methods on hashes in template files. With ruby 1.8,
the order in which the hash is enumerated is random. When using the each
method to scan all hash keys and elements in template files, puppet will
do unnecessary changes in files installed on the server, making it more
difficult to see the real changes. In order to avoid this, we stop using
the "each" method on hashes and instead use the "keys" method to get an
array of all keys and sort it alphabetically.
With ruby 1.9 the hashes enumerate their values in the order that the
corresponding keys were inserted, but we are still using ruby 1.8 with
Mageia 2.
Diffstat (limited to 'modules/buildsystem/templates/iurt.conf')
-rw-r--r-- | modules/buildsystem/templates/iurt.conf | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/buildsystem/templates/iurt.conf b/modules/buildsystem/templates/iurt.conf index ef67e567..b0ed5879 100644 --- a/modules/buildsystem/templates/iurt.conf +++ b/modules/buildsystem/templates/iurt.conf @@ -2,8 +2,9 @@ { supported_arch => [ '<%= distro['arch'].join("', '") %>' ], all_media =>{ -<%- distro['medias'].each{|media, m| -%> - '<%= media %>' => [ '<%= m['repos'].keys.join("', '") %>' ], +<%- distro['medias'].keys.sort.each{|media| -%> + '<%= media %>' => [ '<%= + distro['medias'][media]['repos'].keys.sort.join("', '") %>' ], <%- } -%> }, |