From 3f1e68c783308dcb51242d0fdeef758e581ccc8c Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Tue, 10 May 2016 15:17:26 +0300 Subject: toaster: fix local imports Replaced local imports with absolute imports. Used .module for local imports. This should make the code to work on python 2 and python 3. [YOCTO #9584] Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- lib/toaster/bldcontrol/bbcontroller.py | 2 +- lib/toaster/bldcontrol/localhostbecontroller.py | 2 +- lib/toaster/bldcontrol/management/commands/checksettings.py | 2 +- lib/toaster/bldcontrol/management/commands/loadconf.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/toaster/bldcontrol/bbcontroller.py b/lib/toaster/bldcontrol/bbcontroller.py index d09ac1787..9bddadbf1 100644 --- a/lib/toaster/bldcontrol/bbcontroller.py +++ b/lib/toaster/bldcontrol/bbcontroller.py @@ -79,7 +79,7 @@ def getBuildEnvironmentController(**kwargs): The return object MUST always be a BuildEnvironmentController. """ - from localhostbecontroller import LocalhostBEController + from bldcontrol.localhostbecontroller import LocalhostBEController be = BuildEnvironment.objects.filter(Q(**kwargs))[0] if be.betype == BuildEnvironment.TYPE_LOCAL: diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py index 7b2f126e9..b4e41968f 100644 --- a/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/lib/toaster/bldcontrol/localhostbecontroller.py @@ -32,7 +32,7 @@ import subprocess from toastermain import settings -from bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException, BitbakeController +from bldcontrol.bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException, BitbakeController import logging logger = logging.getLogger("toaster") diff --git a/lib/toaster/bldcontrol/management/commands/checksettings.py b/lib/toaster/bldcontrol/management/commands/checksettings.py index 6b1da1b10..2407e1bbc 100644 --- a/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/lib/toaster/bldcontrol/management/commands/checksettings.py @@ -105,7 +105,7 @@ class Command(NoArgsCommand): try: config_file = os.environ.get('TOASTER_CONF') print("\nImporting file: %s" % config_file) - from loadconf import Command as LoadConfigCommand + from .loadconf import Command as LoadConfigCommand LoadConfigCommand()._import_layer_config(config_file) # we run lsupdates after config update diff --git a/lib/toaster/bldcontrol/management/commands/loadconf.py b/lib/toaster/bldcontrol/management/commands/loadconf.py index 5022b5940..6d25df9e5 100644 --- a/lib/toaster/bldcontrol/management/commands/loadconf.py +++ b/lib/toaster/bldcontrol/management/commands/loadconf.py @@ -4,7 +4,7 @@ from orm.models import BitbakeVersion, Release, ReleaseDefaultLayer, ReleaseLaye from django.db import IntegrityError import os -from checksettings import DN +from .checksettings import DN import logging logger = logging.getLogger("toaster") -- cgit 1.2.3-korg