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)

* 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:
José Pedro Oliveira 2021-01-23 11:45:28 +01:00 committed by GitHub
parent dd0d460132
commit 1dd5e71cff
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):
cmd = ['lldpctl', '-f', 'keyvalue']
cmd = [module.get_bin_path('lldpctl'), '-f', 'keyvalue']
rc, output, err = module.run_command(cmd)
if output:
output_dict = {}