pytest-testinfra
pytest-testinfra copied to clipboard
Salt host matching issue
Running:
>>> d= get_host("salt://*")
>>> d.salt("pkg.version", "python-34")
Produced
RuntimeError: Error while running pkg.version(['python34']): {'minion-salt-689012b2ca3ff805df1d0cff218e18d2d372db887d1158dfd6dec934b9658cf7': '3.4.9-1.el7', 'master-salt-689012b2ca3ff805df1d0cff218e18d2d372db887d1158dfd6dec934b9658cf7': '3.4.9-1.el7'}. Minion not connected ?
Hi, thanks for the PR but you're not supposed to use get_host()
in this case but rather get_hosts()
which return a list of testinfra host
objects on which you can call modules.
However the actual behavior need a specific error message I think.
EDIT: But your usage looks interesting "run commands on minions in a single salt call". I wonder how we could introduce this, your solution works for salt
module but will not work for all other modules.
What do you think about this PR should we close it ?