Files
vagrant-libvirt/spec/support/environment_helper.rb
Nico Tonozzi 3a2335f37c Provide an option to randomize domain name
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.
2014-07-31 09:31:30 -06:00

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