Move Config creation out of Context constructor

This helps to avoid circular dependencies. It also allows the Config
constructor to make use of the global context.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka
2018-08-24 19:17:59 +02:00
committed by Daniel Wagner
parent 594fa97692
commit f5cea27269
3 changed files with 13 additions and 10 deletions

View File

@@ -28,6 +28,7 @@ import subprocess
import os
from .libkas import kasplugin
from .context import create_global_context
from .config import Config
from .libcmds import (Macro, Command, SetupDir, SetupEnviron,
WriteBBConfig, SetupHome, ReposApplyPatches,
CleanupSSHAgent, SetupSSHAgent, SetupRepos)
@@ -75,7 +76,9 @@ class Shell:
if args.cmd != 'shell':
return False
ctx = create_global_context(args.config, args.target, None)
ctx = create_global_context()
ctx.config = Config(args.config, args.target, None)
ctx.config.set_context(ctx)
macro = Macro()