context: Provide global instance

This will avoid the increasingly ugly pushing around of a context
instance as parameter to various methods/functions. Everyone can now
simply call get_context() after build or shell called
create_global_context().

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

View File

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