Example #1
0
 def ensure_compute_mac_address(context):
     mac_address = getattr(context, 'mac_address', None)
     if not mac_address:
         mac_address = mac_addr_kvm_generator()
         context.mac_address = unicode(mac_address)
         vm_parameters.update({'mac_address': mac_address})
     return mac_address
Example #2
0
 def test_mac_addr_kvm_generator(self):
     mac = mac_addr_kvm_generator()
     assert len(mac) == 17
     assert ':' in mac
     assert mac.startswith('52:54:00')