From 6f079cec91cf34fdbbe5d87625f64dd6c22611be Mon Sep 17 00:00:00 2001 From: Lucas Meneghel Rodrigues Date: Mon, 23 Nov 2015 14:39:39 -0200 Subject: [PATCH] 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: Lucas Meneghel Rodrigues --- avocado/core/remoter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/avocado/core/remoter.py b/avocado/core/remoter.py index 7100b918..4be06952 100644 --- a/avocado/core/remoter.py +++ b/avocado/core/remoter.py @@ -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 -- GitLab