X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/b17dd01854b7d2dd4caa29ff4e05c03f3ff69890..3e091ef3d515a094fd4493faacbc5c3ba266c2ad:/cookbooks/chef/libraries/random_password.rb?ds=inline diff --git a/cookbooks/chef/libraries/random_password.rb b/cookbooks/chef/libraries/random_password.rb index f8c6674da..71d8bcfed 100644 --- a/cookbooks/chef/libraries/random_password.rb +++ b/cookbooks/chef/libraries/random_password.rb @@ -1,7 +1,7 @@ class Chef class Recipe def random_password(length) - length.times.collect do + Array.new(length) do "!\#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"[rand(91)].chr end.join end