X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/b17dd01854b7d2dd4caa29ff4e05c03f3ff69890..a5a3b8b5d676e4e7c46f5124325d2ca799bee76f:/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