Skip to content

Commit

Permalink
Merge "Fix merge action plugins verbose output" into stable/xena
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Apr 17, 2023
2 parents 608795e + e8b9b8c commit 85e0176
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions kayobe/plugins/action/merge_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ def run(self, tmp=None, task_vars=None):
del tmp # not used

sources = self._task.args.get('sources', None)
whitespace = self._task.args.get('whitespace', True)

if not isinstance(sources, list):
sources = [sources]

config = OverrideConfigParser(
whitespace=self._task.args.get('whitespace', True))
config = OverrideConfigParser(whitespace=whitespace)

for source in sources:
self.read_config(source, config)
Expand Down Expand Up @@ -219,7 +219,11 @@ def run(self, tmp=None, task_vars=None):
loader=self._loader,
templar=self._templar,
shared_loader_obj=self._shared_loader_obj)
result.update(copy_action.run(task_vars=task_vars))
copy_result = copy_action.run(task_vars=task_vars)
copy_result['invocation']['module_args'].update({
'src': result_file, 'sources': sources,
'whitespace': whitespace})
result.update(copy_result)
finally:
shutil.rmtree(local_tempdir)
return result
6 changes: 5 additions & 1 deletion kayobe/plugins/action/merge_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ def run(self, tmp=None, task_vars=None):
loader=self._loader,
templar=self._templar,
shared_loader_obj=self._shared_loader_obj)
result.update(copy_action.run(task_vars=task_vars))
copy_result = copy_action.run(task_vars=task_vars)
copy_result['invocation']['module_args'].update({
'src': result_file, 'sources': sources,
'extend_lists': extend_lists})
result.update(copy_result)
finally:
shutil.rmtree(local_tempdir)
return result
Expand Down

0 comments on commit 85e0176

Please sign in to comment.