PaloAltoNetworks / ansible-pan

Ansible modules for Palo Alto Networks NGFWs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panos_commit throwing error for optional variables

demakkar opened this issue · comments

Below Playbook stopped working with below errors.looks like its looking for keyword admins in python module and doesn't find any value .we tried putting optional variable but same result.

- name: Commit
           panos_commit:
             ip_address: "{{ inventory_hostname }}"
             username: "{{cli_username}}"
             password: "{{cli_password}}"

Expected behavior

Commit should succeed

Current behavior

Below is the error we see now.

`{
    "exception": "Traceback (most recent call last):\n  File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1578684810.4-5499940255924/AnsiballZ_panos_commit.py\", line 114, in <module>\n    _ansiballz_main()\n  File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1578684810.4-5499940255924/AnsiballZ_panos_commit.py\", line 106, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1578684810.4-5499940255924/AnsiballZ_panos_commit.py\", line 49, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_panos_commit_payload_x_8OCz/__main__.py\", line 127, in <module>\n    \n  File \"/tmp/ansible_panos_commit_payload_x_8OCz/__main__.py\", line 120, in main\n    \nTypeError: commit() got an unexpected keyword argument 'admins'\n",
    "_ansible_no_log": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1578684810.4-5499940255924/AnsiballZ_panos_commit.py\", line 114, in <module>\n    _ansiballz_main()\n  File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1578684810.4-5499940255924/AnsiballZ_panos_commit.py\", line 106, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1578684810.4-5499940255924/AnsiballZ_panos_commit.py\", line 49, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_panos_commit_payload_x_8OCz/__main__.py\", line 127, in <module>\n    \n  File \"/tmp/ansible_panos_commit_payload_x_8OCz/__main__.py\", line 120, in main\n    \nTypeError: commit() got an unexpected keyword argument 'admins'\n",
    "changed": false,
    "module_stdout": "",
    "rc": 1,
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}`

Possible solution

Need to look at optional variable commands in python module panos_commit.py at line 120

Steps to reproduce

Screenshots

Context

Your Environment

  • Version used:2.8.5
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):
  • Operating System and version (desktop or mobile):
  • Link to your project:

@demakkar

It's complaining about a missing keyword in the pandevice invocation, so you just need to update pandevice.

this is resolved by upgrade