Merge branch '1.5' into 2.0

This commit is contained in:
Julien Duponchelle
2016-06-02 13:47:40 +02:00
9 changed files with 110 additions and 25 deletions

View File

@ -28,7 +28,6 @@ import subprocess
import shlex
import asyncio
import socket
import random
import gns3server
from gns3server.utils import parse_version
@ -493,9 +492,10 @@ class QemuVM(BaseNode):
"""
if not mac_address:
self._mac_address = "12:34:%02x:%02x:%02x:00" % (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
# use the node UUID to generate a random MAC address
self._mac_address = "00:%s:%s:%s:%s:00" % (self.project.id[-4:-2], self.project.id[-2:], self.id[-4:-2], self.id[-2:])
else:
self._mac_address = mac_address[:8] + ":%02x:%02x:00" % (random.randint(0, 255), random.randint(0, 255))
self._mac_address = mac_address
log.info('QEMU VM "{name}" [{id}]: MAC address changed to {mac_addr}'.format(name=self._name,
id=self._id,