From 6b8cfecf481956d4dbdbd0436d42a48729179029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Wed, 29 Jun 2016 15:08:34 -0500 Subject: [PATCH] layerindex,rrs: Minor changes to work with python3. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [YOCTO #9746] Signed-off-by: Aníbal Limón --- rrs/tools/common.py | 8 +++++--- rrs/tools/rrs_distros.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rrs/tools/common.py b/rrs/tools/common.py index 32fce45..69a0d01 100644 --- a/rrs/tools/common.py +++ b/rrs/tools/common.py @@ -5,13 +5,15 @@ # # Licensed under the MIT license, see COPYING.MIT for details +import logging + def common_setup(): import sys, os sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../'))) def get_logger(name, settings): - import logging import os + from logging.handlers import RotatingFileHandler logger = logging.getLogger(name) formatter = logging.Formatter("%(asctime)s: %(levelname)s: %(message)s") @@ -22,8 +24,8 @@ def get_logger(name, settings): filename = os.path.join(settings.TOOLS_LOG_DIR, name) maxBytes = 8388608 # 8MB - handler = logging.handlers.RotatingFileHandler(filename, - maxBytes=maxBytes) + handler = RotatingFileHandler(filename, maxBytes=maxBytes) + handler.setFormatter(formatter) logger.addHandler(handler) diff --git a/rrs/tools/rrs_distros.py b/rrs/tools/rrs_distros.py index 46c1058..e0c2def 100755 --- a/rrs/tools/rrs_distros.py +++ b/rrs/tools/rrs_distros.py @@ -122,7 +122,7 @@ if __name__=="__main__": continue distro_info = search_package_in_distros(pkglst_dir, recipe, recipe_data) - for distro, alias in distro_info.iteritems(): + for distro, alias in distro_info.items(): recipedistro = RecipeDistro() recipedistro.recipe = recipe recipedistro.distro = distro