libcmds: Remove protected accesses to Config
There is one remaining protected access in SetupReposStep: an assignment to ctx.config._config. Replace this with a call to ctx.config.find_missing_repos, which already handles this assignment. Remove the TODO comment. There is one remaining protected access in FinishSetupRepos: a read of ctx.config._config for debugging purposes. Replace this with a call to ctx.config.get_config(). Remove the TODO comment. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
7647d7ad3e
commit
682db50916
@ -359,7 +359,6 @@ class SetupReposStep(Command):
|
|||||||
return 'setup_repos_step'
|
return 'setup_repos_step'
|
||||||
|
|
||||||
def execute(self, ctx):
|
def execute(self, ctx):
|
||||||
""" TODO refactor protected-access """
|
|
||||||
if not ctx.missing_repo_names:
|
if not ctx.missing_repo_names:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -389,8 +388,8 @@ class SetupReposStep(Command):
|
|||||||
in ctx.config.repo_dict}
|
in ctx.config.repo_dict}
|
||||||
ctx.missing_repo_names_old = ctx.missing_repo_names
|
ctx.missing_repo_names_old = ctx.missing_repo_names
|
||||||
|
|
||||||
(ctx.config._config, ctx.missing_repo_names) = \
|
ctx.missing_repo_names = \
|
||||||
ctx.config.handler.get_config(repos=repo_paths)
|
ctx.config.find_missing_repos(repo_paths)
|
||||||
|
|
||||||
return ctx.missing_repo_names
|
return ctx.missing_repo_names
|
||||||
|
|
||||||
@ -404,7 +403,6 @@ class FinishSetupRepos(Command):
|
|||||||
return 'finish_setup_repos'
|
return 'finish_setup_repos'
|
||||||
|
|
||||||
def execute(self, ctx):
|
def execute(self, ctx):
|
||||||
""" TODO refactor protected-access """
|
|
||||||
# now fetch everything with complete config and check out layers
|
# now fetch everything with complete config and check out layers
|
||||||
repos_fetch(ctx.config.get_repos())
|
repos_fetch(ctx.config.get_repos())
|
||||||
|
|
||||||
@ -412,4 +410,4 @@ class FinishSetupRepos(Command):
|
|||||||
repo.checkout()
|
repo.checkout()
|
||||||
|
|
||||||
logging.debug('Configuration from config file:\n%s',
|
logging.debug('Configuration from config file:\n%s',
|
||||||
pprint.pformat(ctx.config._config))
|
pprint.pformat(ctx.config.get_config()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user