bushvin/ansible-module-grub

error in code?

Opened this issue · 4 comments

On line 352 you call save_config() with no parameters, but function requires 2 of them, thus crashing

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: save_config() takes exactly 2 arguments (1 given)
fatal: [ansible-test-rhel6.cz.nonprod]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_SowVq5/ansible_module_grub.py\", line 360, in <module>\n    main()\n  File \"/tmp/ansible_SowVq5/ansible_module_grub.py\", line 352, in main\n    (result, msg) = grub.save_config()\nTypeError: save_config() takes exactly 2 arguments (1 given)\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
ls-1N commented

I am also getting this it seems. With -vvvv:

The full traceback is:
Traceback (most recent call last):
  File "/home/me/.ansible/tmp/ansible-tmp-1576430543.03-113030019745522/AnsiballZ_grub.py", line 102, in <module>
    _ansiballz_main()
  File "/home/me/.ansible/tmp/ansible-tmp-1576430543.03-113030019745522/AnsiballZ_grub.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/me/.ansible/tmp/ansible-tmp-1576430543.03-113030019745522/AnsiballZ_grub.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.grub', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib/python2.7/runpy.py", line 188, in run_module
    fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_grub_payload_le2cIV/ansible_grub_payload.zip/ansible/modules/grub.py", line 360, in <module>
  File "/tmp/ansible_grub_payload_le2cIV/ansible_grub_payload.zip/ansible/modules/grub.py", line 352, in main
TypeError: save_config() takes exactly 2 arguments (1 given)

Please try my pull request

ls-1N commented

Not to be mean, but I don't want to be ghosting either - I don't have a working test case right now to reproduce the error (or the lack of it). And the original author hasn't done anything in this repo since 2018, it seems. So it would be a lot of effort and time to get back into this and figure it out.

I worked around this by using the lineinfile module myself.

I somehow forgot about this... Need some time to investigate, possibly accepting #9