1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Code cleanup around ubridge

This commit is contained in:
Julien Duponchelle 2016-11-17 18:11:56 +01:00
parent dcff51eb75
commit e4fdfbd091
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
2 changed files with 54 additions and 54 deletions

View File

@ -208,6 +208,7 @@ class Hypervisor(UBridgeHypervisor):
os.remove(self._stdout_file)
except OSError as e:
log.warning("could not delete temporary uBridge log file: {}".format(e))
self._process = None
self._started = False
def read_stdout(self):

View File

@ -20,6 +20,7 @@ import time
import logging
import asyncio
from ..utils.asyncio import locked_coroutine
from .ubridge_error import UbridgeError
log = logging.getLogger(__name__)
@ -48,7 +49,6 @@ class UBridgeHypervisor:
self._timeout = timeout
self._reader = None
self._writer = None
self._io_lock = asyncio.Lock()
@asyncio.coroutine
def connect(self, timeout=10):
@ -176,7 +176,7 @@ class UBridgeHypervisor:
self._host = host
@asyncio.coroutine
@locked_coroutine
def send(self, command):
"""
Sends commands to this hypervisor.
@ -199,7 +199,6 @@ class UBridgeHypervisor:
# but still have more data. The only thing we know for sure is the last line
# will begin with '100-' or a '2xx-' and end with '\r\n'
with (yield from self._io_lock):
if self._writer is None or self._reader is None:
raise UbridgeError("Not connected")