mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
This commit lets users enable hostname randomization from their Vagrantfile. Without this option enabled, domain creation will fail when multiple VMs are spun up from the same Vagrantfile, due to a domain name conflict.
39 lines
470 B
Ruby
39 lines
470 B
Ruby
require "ostruct"
|
|
require "pathname"
|
|
|
|
class EnvironmentHelper
|
|
|
|
attr_writer :default_prefix, :domain_name
|
|
|
|
attr_accessor :random_hostname, :name
|
|
|
|
def [](value)
|
|
self.send(value.to_sym)
|
|
end
|
|
|
|
def machine
|
|
self
|
|
end
|
|
|
|
def provider_config
|
|
self
|
|
end
|
|
|
|
def default_prefix
|
|
# noop
|
|
end
|
|
|
|
def root_path
|
|
Pathname.new("./spec/support/foo")
|
|
end
|
|
|
|
def domain_name
|
|
#noop
|
|
end
|
|
|
|
def libvirt_compute
|
|
OpenStruct.new(servers: [])
|
|
end
|
|
|
|
end
|