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

@@ -25,6 +25,7 @@
import os
from .context import create_global_context
from .config import Config
from .libkas import find_program, run_cmd, kasplugin
from .libcmds import (Macro, Command, SetupDir, CleanupSSHAgent,
SetupSSHAgent, SetupEnviron, SetupRepos,
@@ -71,7 +72,9 @@ class Build:
if args.cmd != 'build':
return False
ctx = create_global_context(args.config, args.target, args.task)
ctx = create_global_context()
ctx.config = Config(args.config, args.target, args.task)
ctx.config.set_context(ctx)
macro = Macro()