layerindex,rrs: Minor changes to work with python3.

[YOCTO #9746]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
Aníbal Limón 2016-06-29 15:08:34 -05:00 committed by Paul Eggleton
parent 48375d481c
commit 6b8cfecf48
2 changed files with 6 additions and 4 deletions

View File

@ -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)

View File

@ -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