Code Monkey home page Code Monkey logo

Comments (12)

dnorthup-ums avatar dnorthup-ums commented on August 14, 2024 4

Ok, I've tested out a patch against python 2.7.x / ansible 2.9.x, python 3.6.9 / ansible 2.10.10, and python 3.6.9 / ansible 2.11.1. I'll put together a PR, etc... It might take a day or two for me to push out the new revision.

from atom-autocomplete-ansible.

walterrowe avatar walterrowe commented on August 14, 2024 2

The PR above resolved this for me.

 % ansible-playbook --version
ansible-playbook [core 2.11.6] 
  config file = None
  configured module search path = ['/Users/wrowe/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/4.7.0_1/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/wrowe/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.10.0 (default, Oct 13 2021, 06:45:00) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.2
  libyaml = True
Command failed: "/usr/local/Cellar/ansible/4.7.0_1/libexec/bin/python" "/Users/wrowe/.atom/packages/autocomplete-ansible/libs/parse_ansible.py"
Traceback (most recent call last):
  File "/Users/wrowe/.atom/packages/autocomplete-ansible/libs/parse_ansible.py", line 20, in <module>
    BLACKLIST_MODULES = plugin_docs.BLACKLIST['MODULE']
AttributeError: module 'ansible.utils.plugin_docs' has no attribute 'BLACKLIST'
try:
    from ansible.plugins.loader import lookup_loader, module_loader
    from ansible.utils import plugin_docs
    use_old_loader = False
    BLACKLIST_MODULES = plugin_docs.BLACKLIST['MODULE']
except ImportError:
    from ansible.plugins import lookup_loader, module_loader
    from ansible.utils import module_docs as plugin_docs
    use_old_loader = True
    BLACKLIST_MODULES = plugin_docs.BLACKLIST_MODULES

from atom-autocomplete-ansible.

z-deniz avatar z-deniz commented on August 14, 2024

i have the same issue

from atom-autocomplete-ansible.

gunman808 avatar gunman808 commented on August 14, 2024

Same here. I think it is now called REJECTLIST.
https://docs.ansible.com/ansible/latest/user_guide/plugin_filtering_config.html

from atom-autocomplete-ansible.

dnorthup-ums avatar dnorthup-ums commented on August 14, 2024

@k0ste @z-deniz & @gunman808
What version(s) of Ansible & Python are the three of you using?

from atom-autocomplete-ansible.

k0ste avatar k0ste commented on August 14, 2024

@dnorthup-ums

~ % ansible --version
ansible [core 2.11.0]
  config file = None
  configured module search path = ['/Users/k0ste/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/4.0.0/libexec/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/k0ste/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.5 (default, May  4 2021, 03:36:27) [Clang 12.0.0 (clang-1200.0.32.29)]
  jinja version = 3.0.1
  libyaml = True

from atom-autocomplete-ansible.

dnorthup-ums avatar dnorthup-ums commented on August 14, 2024

Looks like ansible/ansible#70028 swapped out the lists one-for-one. Once I've figured out how to test for it a change shouldn't be that complicated.

from atom-autocomplete-ansible.

dnorthup-ums avatar dnorthup-ums commented on August 14, 2024

For those willing to apply the change manually, see the linked PR... As the CI for this repo has broken again I cannot currently merge anything.

from atom-autocomplete-ansible.

Auze avatar Auze commented on August 14, 2024

Tried the patch : excellent. Thank you :)

from atom-autocomplete-ansible.

ParpingTam avatar ParpingTam commented on August 14, 2024

I applied the patch but was still having some issues about a missing key 'module_blacklist'.

I ended up with the following line in my ~/.ansible.cfg file:

PLUGIN_FILTERS_CFG = /etc/ansible/filter_plugins.yml

And the following in the /etc/ansible/filter_plugins.yml file:

---
filter_version: '1.0'
module_rejectlist:
module_blacklist:

from atom-autocomplete-ansible.

Moppiman avatar Moppiman commented on August 14, 2024

I hope that's helps, the plugin_docs.BLACKLIST['MODULE'] has changed to plugin_docs.REJECTLIST['MODULE'].
And i set 'from ansible.plugin_docs import *'

try:
    from ansible.plugins.loader import lookup_loader, module_loader
    # from ansible.utils import plugin_docs
    from ansible.plugin_docs import *
    use_old_loader = False
    BLACKLIST_MODULES = plugin_docs.REJECTLIST['MODULE']
    # BLACKLIST_MODULES = plugin_docs.BLACKLIST['MODULE']
except ImportError:
    from ansible.plugins import lookup_loader, module_loader
    from ansible.utils import module_docs as plugin_docs
    use_old_loader = False
    BLACKLIST_MODULES = plugin_docs.BLACKLIST_MODULE

from atom-autocomplete-ansible.

dnorthup-ums avatar dnorthup-ums commented on August 14, 2024

As Atom is discontinued this extension is also, alas I don't have the access needed to mark it as such.

from atom-autocomplete-ansible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.