mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
don't use full path to command instead use module.get_bin_path
This commit is contained in:
parent
0f4cf8cb43
commit
a59784a581
1 changed files with 33 additions and 28 deletions
|
@ -2179,13 +2179,16 @@ class AIXNetwork(GenericBsdIfconfigNetwork, Network):
|
||||||
self.parse_inet6_line(words, current_if, ips)
|
self.parse_inet6_line(words, current_if, ips)
|
||||||
else:
|
else:
|
||||||
self.parse_unknown_line(words, current_if, ips)
|
self.parse_unknown_line(words, current_if, ips)
|
||||||
|
uname_path = module.get_bin_path('uname')
|
||||||
rc, out, err = module.run_command(['/usr/bin/uname', '-W'])
|
if uname_path:
|
||||||
|
rc, out, err = module.run_command([uname_path, '-W'])
|
||||||
# don't bother with wpars it does not work
|
# don't bother with wpars it does not work
|
||||||
# zero means not in wpar
|
# zero means not in wpar
|
||||||
if out.split()[0] == '0':
|
if out.split()[0] == '0':
|
||||||
if current_if['macaddress'] == 'unknown' and re.match('^en', current_if['device']):
|
if current_if['macaddress'] == 'unknown' and re.match('^en', current_if['device']):
|
||||||
rc, out, err = module.run_command(['/usr/bin/entstat', current_if['device'] ])
|
entstat_path = module.get_bin_path('entstat')
|
||||||
|
if entstat_path:
|
||||||
|
rc, out, err = module.run_command([entstat_path, current_if['device'] ])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
break
|
break
|
||||||
for line in out.split('\n'):
|
for line in out.split('\n'):
|
||||||
|
@ -2200,7 +2203,9 @@ class AIXNetwork(GenericBsdIfconfigNetwork, Network):
|
||||||
current_if['type'] = 'ether'
|
current_if['type'] = 'ether'
|
||||||
# device must have mtu attribute in ODM
|
# device must have mtu attribute in ODM
|
||||||
if 'mtu' not in current_if:
|
if 'mtu' not in current_if:
|
||||||
rc, out, err = module.run_command(['/usr/sbin/lsattr','-El', current_if['device'] ])
|
lsattr_path = module.get_bin_path('lsattr')
|
||||||
|
if lsattr_path:
|
||||||
|
rc, out, err = module.run_command([lsattr_path,'-El', current_if['device'] ])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
break
|
break
|
||||||
for line in out.split('\n'):
|
for line in out.split('\n'):
|
||||||
|
|
Loading…
Add table
Reference in a new issue