fortinet-ansible-dev / ansible-galaxy-fortimanager-collection

GNU General Public License v3.0
16 stars 16 forks source link

Missing imported module AnsibleValidationError.py with version 2.1.6 #55

Closed peterbuza closed 2 years ago

peterbuza commented 2 years ago

Hi Team! After I upgraded FortiManager Galaxy module from 2.1.5 to 2.1.6 I received the following error when executing the fortimanager module.

{
  "msg": "Could not find imported module support code for napi.  Looked for either AnsibleValidationError.py or errors.py",
  "_ansible_no_log": false
}

I found that Fortimanager module /plugins/module_utils/napy.py module introduced a new import for "AnsibleValidationError" (from ansible.module_utils.errors import AnsibleValidationError), but this is not in the ansible python modules. Ansible version meets the requirements 2.9+:

bash-4.4# ansible --version
ansible 2.9.18
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/var/lib/awx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

Can I fix this somehow with the current Ansible version?

Thanks in advance.

chillancezen commented 2 years ago

hi @peterbuza Peter,

thanks so much for letting us know the issue. we will fix it and release it immediately, meanwhile, you can install latest ansible pip3 install ansible-core as a workaround.

thanks, Link.

peterbuza commented 2 years ago

Hi @chillancezen, thank you for the quick notification. I am looking forward to hearing the fixed release.

chillancezen commented 2 years ago

hi @peterbuza Peter,

we have a new release 2.1.7 which covers the fix, you could cover your 2.1.6 by ansible-galaxy collection install -fn fortinet.fortimanager, please let me know if the issue persists in your env.

thanks, Link.

peterbuza commented 2 years ago

Hi @chillancezen Link,

I successfully tested version 2.1.7. Thank you very much for your quick response.