From c4598268770e574f90607bb267fc7d6f5a715cf4 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Mon, 6 Feb 2017 10:53:43 -0500 Subject: [PATCH] Remote Runner: assume dependencies are fulfilled This is a prep work for making the Remote Runner an optional plugin. By installing the Remote Runner through the usual ways (setup.py) the dependencies will always be fullfilled, so this manual check is not needed or desirable. If users still want to check for the presence of this feature, they should use standard Python pkg_resources for that. Signed-off-by: Cleber Rosa --- avocado/core/remoter.py | 19 ++++++------------- avocado/core/virt.py | 5 ----- avocado/plugins/remote.py | 4 ---- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/avocado/core/remoter.py b/avocado/core/remoter.py index 78be5a6f..c795c272 100644 --- a/avocado/core/remoter.py +++ b/avocado/core/remoter.py @@ -20,22 +20,15 @@ import getpass import os import time +import fabric.api +import fabric.network +import fabric.operations +import fabric.tasks +from fabric.context_managers import shell_env + from .settings import settings from ..utils import process -try: - import fabric.api - import fabric.network - import fabric.operations - import fabric.tasks - from fabric.context_managers import shell_env -except ImportError: - REMOTE_CAPABLE = False - LOG.info('Remote module is disabled: could not import fabric') - fabric = None -else: - REMOTE_CAPABLE = True - class RemoterError(Exception): pass diff --git a/avocado/core/virt.py b/avocado/core/virt.py index fafcff44..4aedc7f7 100644 --- a/avocado/core/virt.py +++ b/avocado/core/virt.py @@ -33,11 +33,6 @@ else: VIRT_CAPABLE = True -if remoter.REMOTE_CAPABLE is False: - VIRT_CAPABLE = False - LOG.info('Virt module is disabled: remote module is disabled') - - class VirtError(Exception): """ diff --git a/avocado/plugins/remote.py b/avocado/plugins/remote.py index 4430263e..247e5f95 100644 --- a/avocado/plugins/remote.py +++ b/avocado/plugins/remote.py @@ -20,7 +20,6 @@ import sys from avocado.core import exit_codes from avocado.core import loader -from avocado.core import remoter from avocado.core.plugin_interfaces import CLI from avocado.core.remote import RemoteTestRunner @@ -35,9 +34,6 @@ class Remote(CLI): description = "Remote machine options for 'run' subcommand" def configure(self, parser): - if remoter.REMOTE_CAPABLE is False: - return - run_subcommand_parser = parser.subcommands.choices.get('run', None) if run_subcommand_parser is None: return -- GitLab