saltstack/salt — Issue #592: status.netdev IndexError
Author: teichopsia
Created: 2012-01-27 20:17:30+00:00
State: open

salt-0.9.6/salt$ salt foo status.netdev

11:42:19,690 [salt.minion ][WARNING ] The minion function caused an exception: Traceback (most recent call last):
File "salt-minion/local/lib/python2.7/site-packages/salt/minion.py", line 210, in _thread_return
ret['return'] = self.functions[data['fun']](*data['arg'])
File "salt-minion/local/lib/python2.7/site-packages/salt/modules/status.py", line 360, in netdev
'tx_compressed': _number(comps[16]),
IndexError: list index out of range

oneliner fixes this. the logic to handle a lack of space between the interface and first field replaces field 1 instead inserting a new column between 0 and 1.

347c347
< comps[1] = line.split(':')[1].strip().split()[0]
---
> comps.insert(1,line.split(':')[1].strip().split()[0])