From 33e3dee9e7eb88b2e39bfc1b08f49f399a54ae40 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 1 Mar 2018 17:03:39 +1300 Subject: [PATCH] rrs/tools/common.py: import sys/os at top These are common enough that they should be imported up front. Signed-off-by: Paul Eggleton --- rrs/tools/common.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rrs/tools/common.py b/rrs/tools/common.py index b69b701..5b720a1 100644 --- a/rrs/tools/common.py +++ b/rrs/tools/common.py @@ -5,6 +5,8 @@ # # Licensed under the MIT license, see COPYING.MIT for details +import sys +import os import logging class DryRunRollbackException(Exception): @@ -12,12 +14,10 @@ class DryRunRollbackException(Exception): def common_setup(): - import sys, os sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../'))) sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../layerindex'))) def get_logger(name, settings): - import os from logging.handlers import RotatingFileHandler logger = logging.getLogger(name) @@ -39,7 +39,6 @@ def get_logger(name, settings): return logger def update_repo(fetchdir, repo_name, repo_url, pull, logger): - import os from layerindex import utils, recipeparse path = os.path.join(fetchdir, repo_name) @@ -69,7 +68,6 @@ def get_pv_type(pv): def get_recipe_files(layerdir): from layerindex import recipeparse - import os sublayer_dirs = [] for root, dirs, files in os.walk(layerdir):