mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Allow empty prefix for domain names
Allows one to set a empty prefix for domain names and it would create domain with the same name as set by define method in the Vagrantfile. Signed-off-by: raghavendra talur <raghavendra.talur@gmail.com>
This commit is contained in:
parent
1ad103181e
commit
97dd1f20f2
@ -46,11 +46,13 @@ module VagrantPlugins
|
||||
config = env[:machine].provider_config
|
||||
domain_name =
|
||||
if config.default_prefix.nil?
|
||||
env[:root_path].basename.to_s.dup
|
||||
env[:root_path].basename.to_s.dup.concat("_")
|
||||
elsif config.default_prefix.empty?
|
||||
# don't have any prefix, not even "_"
|
||||
""
|
||||
else
|
||||
config.default_prefix.to_s
|
||||
config.default_prefix.to_s.concat("_")
|
||||
end
|
||||
domain_name << '_'
|
||||
domain_name << env[:machine].name.to_s
|
||||
domain_name.gsub!(/[^-a-z0-9_]/i, '')
|
||||
domain_name << "_#{Time.now.utc.to_i}_#{SecureRandom.hex(10)}" if config.random_hostname
|
||||
|
Loading…
Reference in New Issue
Block a user