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

The DependencyMixin is being deprecated. #6639

Closed
1 task done
marek22k opened this issue Jun 7, 2023 · 4 comments · Fixed by #6644
Closed
1 task done

The DependencyMixin is being deprecated. #6639

marek22k opened this issue Jun 7, 2023 · 4 comments · Fixed by #6644
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)

Comments

@marek22k
Copy link

marek22k commented Jun 7, 2023

Summary

When I use the module to blacklist a kernel module, a warning appears.

Issue Type

Bug Report

Component Name

kernel_blacklist

Ansible Version

$ansible --version
ansible [core 2.15.0]
  config file = None
  configured module search path = ['/home/bandura/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/bandura/.local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/bandura/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/bandura/.local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Community.general Version

$ansible-galaxy collection list community.general

# /home/bandura/.local/lib/python3.9/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 7.0.1

Configuration

$ansible-config dump --only-changed
CONFIG_FILE() = None

OS / Environment

Debian 11-based

Steps to Reproduce

- name: Blacklist old kernel module
  become: true
  community.general.kernel_blacklist:
    name: x_tables

Expected Results

No warning

Actual Results

Works, but with warning.

TASK [install-nftables : Blacklist old IPv4 kernel module] *********************
[DEPRECATION WARNING]: The DependencyMixin is being deprecated. Modules should 
use community.general.plugins.module_utils.deps instead. This feature will be 
removed from community.general in version 9.0.0. Deprecation warnings can be 
disabled by setting deprecation_warnings=False in ansible.cfg.

Code of Conduct

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

CC @russoz

@ansibullbot
Copy link
Collaborator

cc @matze
click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Jun 7, 2023
@felixfontein
Copy link
Collaborator

The deprecation was added in #6465. @russoz do you think you can adjust the code to only emit it if it is used explicitly outside of ModuleHelper? Otherwise we should probably revert the deprecation for now.

@russoz
Copy link
Collaborator

russoz commented Jun 8, 2023

hi, that mixin is not going to work outside of ModuleHelper (unless someone create a class that mimics some aspects of MH).

But I found out what seems to be the problem: that deprecation is popping up regardless if the dependency mixin is actually used - in fact kernel_blacklist does not use it. I will be submitting a PR tomorrow to address that.

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 module module plugins plugin (any type)
Projects
None yet
4 participants