add missing AIX network facts discovery

This commit is contained in:
Boris Manojlovic 2015-03-10 15:19:29 +01:00
parent 2da8a986c4
commit 0f4cf8cb43

View file

@ -2180,6 +2180,34 @@ class AIXNetwork(GenericBsdIfconfigNetwork, Network):
else:
self.parse_unknown_line(words, current_if, ips)
rc, out, err = module.run_command(['/usr/bin/uname', '-W'])
# don't bother with wpars it does not work
# zero means not in wpar
if out.split()[0] == '0':
if current_if['macaddress'] == 'unknown' and re.match('^en', current_if['device']):
rc, out, err = module.run_command(['/usr/bin/entstat', current_if['device'] ])
if rc != 0:
break
for line in out.split('\n'):
if not line:
pass
buff = re.match('^Hardware Address: (.*)', line)
if buff:
current_if['macaddress'] = buff.group(1)
buff = re.match('^Device Type:', line)
if buff and re.match('.*Ethernet', line):
current_if['type'] = 'ether'
# device must have mtu attribute in ODM
if 'mtu' not in current_if:
rc, out, err = module.run_command(['/usr/sbin/lsattr','-El', current_if['device'] ])
if rc != 0:
break
for line in out.split('\n'):
if line:
words = line.split()
if words[0] == 'mtu':
current_if['mtu'] = words[1]
return interfaces, ips
# AIX 'ifconfig -a' does not inform about MTU, so remove current_if['mtu'] here