diff --git a/gns3server/modules/dynamips/dynamips_hypervisor.py b/gns3server/modules/dynamips/dynamips_hypervisor.py index 6943c862..dfafc4de 100644 --- a/gns3server/modules/dynamips/dynamips_hypervisor.py +++ b/gns3server/modules/dynamips/dynamips_hypervisor.py @@ -81,8 +81,8 @@ class DynamipsHypervisor: while time.time() - begin < timeout: yield from asyncio.sleep(0.01) try: - self._reader, self._writer = yield from asyncio.open_connection(host, self._port) - except OSError as e: + self._reader, self._writer = yield from asyncio.wait_for(asyncio.open_connection(host, self._port), timeout=1) + except (asyncio.TimeoutError, OSError) as e: last_exception = e continue connection_success = True diff --git a/gns3server/modules/nios/nio.py b/gns3server/modules/nios/nio.py index 57418a19..b77fbf64 100644 --- a/gns3server/modules/nios/nio.py +++ b/gns3server/modules/nios/nio.py @@ -30,8 +30,6 @@ class NIO(object): def __init__(self): - # create an unique name - self._name = 'nio-{}'.format(uuid.uuid4()) self._capturing = False self._pcap_output_file = "" self._pcap_data_link_type = "" @@ -78,23 +76,3 @@ class NIO(object): """ return self._pcap_data_link_type - - - def __str__(self): - """ - NIO string representation. - - :returns: NIO name - """ - - return self._name - - @property - def name(self): - """ - Returns the NIO name. - - :returns: NIO name - """ - - return self._name