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

plugins.callback.unixy: Warning 'CallbackModule' object has no attribute 'display_failed_stderr' #5600

Closed
1 task done
kerel-fs opened this issue Nov 24, 2022 · 3 comments · Fixed by #5601 or #5744
Closed
1 task done
Labels
bug This issue/PR relates to a bug callback callback plugin plugins plugin (any type)

Comments

@kerel-fs
Copy link
Contributor

Summary

When using the community.general.unixy callback plugin with a recent version of ansible I get a warning 'CallbackModule' object has no attribute 'display_failed_stderr' and the task output is not shown.

This is a regression introduced by ansible/ansible@dbdbfe8 via ansible/ansible#77677

I already prepared a patch to fix this by using the new self.get_option interface and I'd be happy to open a PR with it.

Issue Type

Bug Report

Component Name

community.general.unixy

Ansible Version

$ ansible --version
ansible [core 2.14.0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/kerel/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home/kerel/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.8 (main, Nov  1 2022, 14:18:21) [GCC 12.2.0] (/usr/bin/python)
  jinja version = 3.1.2
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /usr/lib/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 5.8.0  

Configuration

$ cat ansible.cfg
[defaults]
stdout_callback = unixy

OS / Environment

Manjaro Linux 22.0

Steps to Reproduce

Any playbook with tasks producing output will trigger this. I tested with the following:

playbook.yml:

---
- hosts: all
  tasks:
    - ansible.builtin.ping:
$ ansible-playbook playbook.yml

# in my specific case I run inside a virtualbox using vagrant:
$ sudo vagrant provision debian_bullseye --provision-with version

Expected Results

The task output should be shown.

Actual Results

Task output is missing, but warning shown:

==> debian_bullseye: Running provisioner: version (ansible)...
    debian_bullseye: Running ansible-playbook...
Executing playbook check_version.yml

- all on hosts: all -
Gathering Facts...
[WARNING]: Failure using method (v2_runner_on_ok) in callback plugin
(<ansible_collections.community.general.plugins.callback.unixy.CallbackModule
object at 0x7fb06d861a20>): 'CallbackModule' object has no attribute
'display_failed_stderr'
ansible.builtin.ping...

- Play recap -
  debian_bullseye            : ok=2    changed=0    unreachable=0    failed=0    rescued=0    ignored=0   

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

cc @akatch
click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug callback callback plugin plugins plugin (any type) labels Nov 24, 2022
@kerel-fs
Copy link
Contributor Author

!component =plugins/callback/unixy.py

kerel-fs added a commit to kerel-fs/ansible-community.general that referenced this issue Nov 24, 2022
kerel-fs added a commit to kerel-fs/ansible-community.general that referenced this issue Nov 28, 2022
In ansible-core 2.14 deprecated support was removed[1] for accessing options
of the DefaultCallback via class attributes. Use the "new" config system
instead.

[1]: ansible/ansible@dbdbfe8

Fixes ansible-collections#5600.

Signed-off-by: Fabian P. Schmidt <[email protected]>
felixfontein added a commit that referenced this issue Nov 28, 2022
* unixy Callback: Use Ansible's config manager

In ansible-core 2.14 deprecated support was removed[1] for accessing options
of the DefaultCallback via class attributes. Use the "new" config system
instead.

[1]: ansible/ansible@dbdbfe8

Fixes #5600.

Signed-off-by: Fabian P. Schmidt <[email protected]>

* Update changelog fragment.

Signed-off-by: Fabian P. Schmidt <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
patchback bot pushed a commit that referenced this issue Nov 28, 2022
* unixy Callback: Use Ansible's config manager

In ansible-core 2.14 deprecated support was removed[1] for accessing options
of the DefaultCallback via class attributes. Use the "new" config system
instead.

[1]: ansible/ansible@dbdbfe8

Fixes #5600.

Signed-off-by: Fabian P. Schmidt <[email protected]>

* Update changelog fragment.

Signed-off-by: Fabian P. Schmidt <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 53da86c)
patchback bot pushed a commit that referenced this issue Nov 28, 2022
* unixy Callback: Use Ansible's config manager

In ansible-core 2.14 deprecated support was removed[1] for accessing options
of the DefaultCallback via class attributes. Use the "new" config system
instead.

[1]: ansible/ansible@dbdbfe8

Fixes #5600.

Signed-off-by: Fabian P. Schmidt <[email protected]>

* Update changelog fragment.

Signed-off-by: Fabian P. Schmidt <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 53da86c)
felixfontein pushed a commit that referenced this issue Nov 29, 2022
* unixy Callback: Use Ansible's config manager

In ansible-core 2.14 deprecated support was removed[1] for accessing options
of the DefaultCallback via class attributes. Use the "new" config system
instead.

[1]: ansible/ansible@dbdbfe8

Fixes #5600.

Signed-off-by: Fabian P. Schmidt <[email protected]>

* Update changelog fragment.

Signed-off-by: Fabian P. Schmidt <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 53da86c)

Co-authored-by: Fabian P. Schmidt <[email protected]>
felixfontein pushed a commit that referenced this issue Nov 29, 2022
* unixy Callback: Use Ansible's config manager

In ansible-core 2.14 deprecated support was removed[1] for accessing options
of the DefaultCallback via class attributes. Use the "new" config system
instead.

[1]: ansible/ansible@dbdbfe8

Fixes #5600.

Signed-off-by: Fabian P. Schmidt <[email protected]>

* Update changelog fragment.

Signed-off-by: Fabian P. Schmidt <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 53da86c)

Co-authored-by: Fabian P. Schmidt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug callback callback plugin plugins plugin (any type)
Projects
None yet
2 participants