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

command module fails when used with integer list element in argv #43732

Closed
Nirkus opened this issue Aug 6, 2018 · 1 comment · Fixed by #43734
Closed

command module fails when used with integer list element in argv #43732

Nirkus opened this issue Aug 6, 2018 · 1 comment · Fixed by #43734
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.

Comments

@Nirkus
Copy link

Nirkus commented Aug 6, 2018

SUMMARY

Using module command with an integer as a list element of argv fails, probably while trying to serialize the integer.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

module command

ANSIBLE VERSION
$ ansible --version
ansible 2.6.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/******/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/******/somedir/ansible/lib/ansible
  executable location = /home/******/somedir/ansible/bin/ansible
  python version = 2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0 20170516]
CONFIGURATION

None

OS / ENVIRONMENT

Controller: Debian 9 ("stretch")
Servers configured via ansible are CentOS 7.5.

STEPS TO REPRODUCE
- name: set global options for all gluster volumes
  run_once: true
  command:
  args:
    argv:
      - gluster
      - volume
      - set
      - all
      - cluster.server-quorum-ratio
      - 51
EXPECTED RESULTS

Integer 51 serialized as a string argument.

ACTUAL RESULTS

Module fails with python exception.

fatal: [host1.example.invalid]: FAILED! => {"changed": false, "module_stderr": "Shared connection to host1.example.invalid closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_Nv59ki/ansible_module_command.py\", line 271, in <module>\r\n    main()\r\n  File \"/tmp/ansible_Nv59ki/ansible_module_command.py\", line 248, in main\r\n    rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin)\r\n  File \"/tmp/ansible_Nv59ki/ansible_modlib.zip/ansible/module_utils/basic.py\", line 2774, in run_command\r\n  File \"/usr/lib64/python2.7/posixpath.py\", line 293, in expandvars\r\n    if '$' not in path:\r\nTypeError: argument of type 'int' is not iterable\r\n", "msg": "MODULE FAILURE", "rc": 1}
@ansibot
Copy link
Contributor

ansibot commented Aug 6, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback. labels Aug 6, 2018
@sivel sivel changed the title module command fails when used with integer list element in argv command module fails when used with integer list element in argv Aug 6, 2018
agaffney added a commit to agaffney/ansible that referenced this issue Aug 6, 2018
agaffney added a commit to agaffney/ansible that referenced this issue Aug 6, 2018
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Aug 10, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants