From 4650bec70d595a7ecc38913aa67178e01ddf4e73 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Mon, 8 Jun 2015 14:36:07 -0300 Subject: [PATCH] API review: move avocado.linux.distro to avocado.utils.distro This is a utility module with no dependency on any other Avocado module, so a good candidate for the utils namespace. Signed-off-by: Cleber Rosa --- avocado/core/plugins/distro.py | 6 +++--- avocado/linux/software_manager.py | 2 +- avocado/{linux => utils}/distro.py | 0 selftests/all/unit/avocado/distro_unittest.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename avocado/{linux => utils}/distro.py (100%) diff --git a/avocado/core/plugins/distro.py b/avocado/core/plugins/distro.py index 922c09bb..0492b837 100644 --- a/avocado/core/plugins/distro.py +++ b/avocado/core/plugins/distro.py @@ -22,7 +22,7 @@ from avocado.core import exit_codes from avocado.core.plugins import plugin from avocado.utils import process from avocado.utils import path as utils_path -from avocado.linux import distro as distro_utils +from avocado.utils import distro as utils_distro class SoftwarePackage(object): @@ -55,7 +55,7 @@ class SoftwarePackage(object): return json.dumps(self.to_dict()) -class DistroDef(distro_utils.LinuxDistro): +class DistroDef(utils_distro.LinuxDistro): """ More complete information on a given Linux Distribution @@ -373,7 +373,7 @@ class DistroOptions(plugin.Plugin): msg=('Distro information saved ' 'to "%s"' % output_file_name)) else: - detected = distro_utils.detect() + detected = utils_distro.detect() msg = 'Detected distribution: %s (%s) version %s release %s' % ( detected.name, detected.arch, diff --git a/avocado/linux/software_manager.py b/avocado/linux/software_manager.py index 05395c43..c4826f26 100644 --- a/avocado/linux/software_manager.py +++ b/avocado/linux/software_manager.py @@ -48,7 +48,7 @@ except ImportError: from avocado.utils import process from avocado.utils import data_factory -from avocado.linux import distro +from avocado.utils import distro from avocado.core import exceptions from avocado.utils import path as utils_path diff --git a/avocado/linux/distro.py b/avocado/utils/distro.py similarity index 100% rename from avocado/linux/distro.py rename to avocado/utils/distro.py diff --git a/selftests/all/unit/avocado/distro_unittest.py b/selftests/all/unit/avocado/distro_unittest.py index 1f4d3f35..e777f7ce 100644 --- a/selftests/all/unit/avocado/distro_unittest.py +++ b/selftests/all/unit/avocado/distro_unittest.py @@ -13,7 +13,7 @@ if os.path.isdir(os.path.join(basedir, 'avocado')): sys.path.append(basedir) -from avocado.linux import distro +from avocado.utils import distro class ProbeTest(unittest.TestCase): -- GitLab