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

salt.modules.keyboard function get_sys traceback when cmd.run fails #56071

Open
eqvis opened this issue Feb 5, 2020 · 1 comment
Open

salt.modules.keyboard function get_sys traceback when cmd.run fails #56071

eqvis opened this issue Feb 5, 2020 · 1 comment
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@eqvis
Copy link

eqvis commented Feb 5, 2020

Description of Issue

File "/usr/lib/python3/dist-packages/salt/modules/keyboard.py", line 50, in get_sys
ret = out[1].replace('"', '')
IndexError: list index out of range

Setup (sls):

set /etc/default/keyboard:
  keyboard.system:
    - name: de

As in https://docs.saltstack.com/en/develop/ref/modules/all/salt.modules.keyboard.html

Steps to Reproduce Issue

If the internal cmd.run for get_sys does not work (logged out = 'Could not get properties: Connection timed out') the traceback appears!

salt --versions-report

Salt Version:
Salt: 2019.2.2

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.3
gitpython: 2.1.8
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.6.9 (default, Nov 7 2019, 10:44:02)
python-gnupg: 0.4.1
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 2.0.3
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.5

System Versions:
dist: Ubuntu 18.04 bionic
locale: ANSI_X3.4-1968
machine: x86_64
release: 4.15.0-64-generic
system: Linux
version: Ubuntu 18.04 bionic

@dhiltonp dhiltonp added the Bug broken, incorrect, or confusing behavior label Feb 5, 2020
@dhiltonp
Copy link
Contributor

dhiltonp commented Feb 5, 2020

Thanks for the report!

When fixing this, it would be good to survey other uses of cmd.run to make sure failures are appropriately handled. This will mostly be cases where the return is processed in some way (not being returned directly).

@dhiltonp dhiltonp added team-core P3 Priority 3 labels Feb 5, 2020
@dhiltonp dhiltonp added this to the Approved milestone Feb 5, 2020
@sagetherage sagetherage removed the P3 Priority 3 label Jun 3, 2020
@sagetherage sagetherage added the severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around label Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

3 participants