mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
lldp - use get_bin_path to locate the lldpctl executable (#1643)
* lldp - use get_bin_path to locate the lldpctl executable * This prevents failed executions FAILED! => {"changed": false, "cmd": "lldpctl -f keyvalue", "msg": "[Errno 2] No such file or directory", "rc": 2} on hosts (servers and switches) with lldpd installed and running. * Update changelogs/fragments/lldp-use-get_bin_path-to-locate-the-lldpctl-executable.yaml Specify pull request id and minor formatting tweaks Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/lldp-use-get_bin_path-to-locate-the-lldpctl-executable.yaml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
dd0d460132
commit
1dd5e71cff
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- lldp - use ``get_bin_path`` to locate the ``lldpctl`` executable (https://github.com/ansible-collections/community.general/pull/1643).
|
|
@ -41,7 +41,7 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
|
||||
|
||||
def gather_lldp(module):
|
||||
cmd = ['lldpctl', '-f', 'keyvalue']
|
||||
cmd = [module.get_bin_path('lldpctl'), '-f', 'keyvalue']
|
||||
rc, output, err = module.run_command(cmd)
|
||||
if output:
|
||||
output_dict = {}
|
||||
|
|
Loading…
Reference in a new issue