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