X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/b17dd01854b7d2dd4caa29ff4e05c03f3ff69890..0f4a3b7bfe4204c30907d1d34cbee26e966b997a:/cookbooks/chef/libraries/random_password.rb 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