Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set play context on stdout callback plugin #35910

Merged
merged 1 commit into from Nov 30, 2018

Conversation

emonty
Copy link
Contributor

@emonty emonty commented Feb 8, 2018

SUMMARY

The loop on self._callback_plugins does not include the stdout callback,
so the stdout_callback never has set_play_context called.

ISSUE TYPE
  • Bugfix Pull Request

The loop on self._callback_plugins does not include the stdout callback,
so the stdout_callback never has set_play_context called.
@ansibot ansibot added bugfix_pull_request needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Feb 8, 2018
@s-hertel s-hertel removed the needs_triage Needs a first human triage before being processed. label Feb 9, 2018
@diafour
Copy link
Contributor

diafour commented Feb 15, 2018

Spot this problem too. I think the better way to fix this is to concatenate arrays similar to send_callback method:

def send_callback(self, method_name, *args, **kwargs):
    for callback_plugin in [self._stdout_callback] + self._callback_plugins:

@webknjaz
Copy link
Member

@diafour I'd also suggest using itertools.chain() instead of concatenation.

@diafour
Copy link
Contributor

diafour commented Feb 15, 2018

Um.. and why not to use send_callback('set_play_context', play_context)? It looks safe. Has no deep knowledge about internals, just curious.

@webknjaz
Copy link
Member

@diafour it was just my addition to your snippet, I'm not discouraging your approach, just augmenting it.

@diafour
Copy link
Contributor

diafour commented Feb 15, 2018

@webknjaz got that ;) I was augmented too.

@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Feb 23, 2018
@ansibot ansibot added the affects_2.6 This issue/PR affects Ansible v2.6 label May 21, 2018
@ansibot ansibot added the core_review In order to be merged, this PR must follow the core review workflow. label Oct 24, 2018
@bcoca
Copy link
Member

bcoca commented Nov 30, 2018

rebuild_merge

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 30, 2018
@ansibot ansibot merged commit 824c72d into ansible:devel Nov 30, 2018
kbreit pushed a commit to kbreit/ansible that referenced this pull request Jan 11, 2019
The loop on self._callback_plugins does not include the stdout callback,
so the stdout_callback never has set_play_context called.
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants