1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

Consolidate dictionary into creation, trigger CI

This commit is contained in:
philippeitis
2020-03-04 16:14:03 -08:00
committed by GitHub
parent 498d51b4e8
commit de28932650

View File

@ -196,12 +196,13 @@ def parse(data, raw=False, quiet=False):
raw_output = [] raw_output = []
for line in cleandata: for line in cleandata:
line = line.split() line = line.split()
output_line = {} output_line = {
output_line['name'] = line[0] 'name': line[0],
output_line['address'] = line[1].lstrip('(').rstrip(')') 'address': line[1].lstrip('(').rstrip(')'),
output_line['hwtype'] = line[4].lstrip('[').rstrip(']') 'hwtype': line[4].lstrip('[').rstrip(']'),
output_line['hwaddress'] = line[3] 'hwaddress': line[3],
output_line['iface'] = line[6] 'iface': line[6],
}
raw_output.append(output_line) raw_output.append(output_line)
if raw: if raw: