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