lib/vagrant-mutate/box/libvirt.rb in vagrant-mutate-0.2.3 vs lib/vagrant-mutate/box/libvirt.rb in vagrant-mutate-0.2.4
- old
+ new
@@ -9,10 +9,11 @@
@provider_name = 'libvirt'
@supported_input = true
@supported_output = true
@image_format = 'qcow2'
@image_name = 'box.img'
+ @mac = nil
end
# since none of below can be determined from the box
# we just generate sane values
@@ -20,11 +21,14 @@
return 'x86_64'
end
# kvm prefix is 52:54:00
def mac_address
- octets = 3.times.map { rand(255).to_s(16) }
- return "52:54:00:#{octets[0]}:#{octets[1]}:#{octets[2]}"
+ unless @mac
+ octets = 3.times.map { rand(255).to_s(16) }
+ @mac = "525400#{octets[0]}#{octets[1]}#{octets[2]}"
+ end
+ return @mac
end
def cpus
return 1
end