提交 6f079cec 编写于 作者: L Lucas Meneghel Rodrigues

avocado.core.remoter: Fix error on exception reference

fabric.network was never imported in avocado.core.remoter,
but fabric.network.NetworkError was referenced in its code,
making the exception to never actually be captured. Let's
fix it.

While at it, let's resolve one complaint of the pycharm
python checker: When importing some module on a try/except
block, make some effort to define the module in case of
failure.
Signed-off-by: NLucas Meneghel Rodrigues <lookkas@gmail.com>
上级 5297cc0e
......@@ -26,10 +26,12 @@ LOG = logging.getLogger('avocado.test')
try:
import fabric.api
import fabric.network
import fabric.operations
except ImportError:
REMOTE_CAPABLE = False
LOG.info('Remote module is disabled: could not import fabric')
fabric = None
else:
REMOTE_CAPABLE = True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册