1
0
Fork 0
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) (#1663)

* 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>
(cherry picked from commit 1dd5e71cff)

Co-authored-by: José Pedro Oliveira <jose.p.oliveira.oss@gmail.com>
This commit is contained in:
patchback[bot] 2021-01-23 12:15:33 +01:00 committed by GitHub
parent 5ece46c56e
commit 90c278ad87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- lldp - use ``get_bin_path`` to locate the ``lldpctl`` executable (https://github.com/ansible-collections/community.general/pull/1643).

View file

@ -41,7 +41,7 @@ from ansible.module_utils.basic import AnsibleModule
def gather_lldp(module): def gather_lldp(module):
cmd = ['lldpctl', '-f', 'keyvalue'] cmd = [module.get_bin_path('lldpctl'), '-f', 'keyvalue']
rc, output, err = module.run_command(cmd) rc, output, err = module.run_command(cmd)
if output: if output:
output_dict = {} output_dict = {}