[DRE-commits] [vagrant-libvirt] 79/104: Use random string in name of domain

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Apr 24 13:55:49 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag 0.0.11
in repository vagrant-libvirt.

commit 60442c58523c26f33dcb21417959a486ba6da744
Author: Brian Pitts <brian at polibyte.com>
Date:   Wed Sep 25 11:43:00 2013 -0500

    Use random string in name of domain
---
 lib/vagrant-libvirt/action/set_name_of_domain.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/vagrant-libvirt/action/set_name_of_domain.rb b/lib/vagrant-libvirt/action/set_name_of_domain.rb
index 4edf359..7ff0e49 100644
--- a/lib/vagrant-libvirt/action/set_name_of_domain.rb
+++ b/lib/vagrant-libvirt/action/set_name_of_domain.rb
@@ -9,9 +9,10 @@ module VagrantPlugins
         end
 
         def call(env)
+          require 'securerandom'
           env[:domain_name] = env[:root_path].basename.to_s.dup
           env[:domain_name].gsub!(/[^-a-z0-9_]/i, "")
-          env[:domain_name] << "_#{Time.now.to_i}"
+          env[:domain_name] << "_#{SecureRandom.hex}"
 
           # Check if the domain name is not already taken
           domain = ProviderLibvirt::Util::Collection.find_matching(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/vagrant-libvirt.git



More information about the Pkg-ruby-extras-commits mailing list