From 91f680a749dfdb3702fee0282587f792de8d6662 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Thu, 1 Aug 2024 17:12:57 -0700 Subject: [PATCH] Remove extraneous get_bin_path call (#83675) ip_path is already calculated before calling get_interfaces_info Signed-off-by: Abhijeet Kasurde Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com> Co-authored-by: Brian Coca --- changelogs/fragments/linux_network_get.yml | 3 +++ lib/ansible/module_utils/facts/network/linux.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/linux_network_get.yml diff --git a/changelogs/fragments/linux_network_get.yml b/changelogs/fragments/linux_network_get.yml new file mode 100644 index 00000000000..01af77621d3 --- /dev/null +++ b/changelogs/fragments/linux_network_get.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - linux - remove extraneous get_bin_path API call. diff --git a/lib/ansible/module_utils/facts/network/linux.py b/lib/ansible/module_utils/facts/network/linux.py index 560cd255f37..d199d5a6ae3 100644 --- a/lib/ansible/module_utils/facts/network/linux.py +++ b/lib/ansible/module_utils/facts/network/linux.py @@ -295,8 +295,6 @@ class LinuxNetwork(Network): if not address == '::1': ips['all_ipv6_addresses'].append(address) - ip_path = self.module.get_bin_path("ip") - args = [ip_path, 'addr', 'show', 'primary', 'dev', device] rc, primary_data, stderr = self.module.run_command(args, errors='surrogate_then_replace') if rc == 0: