Accept interfaces without address family or method (#34200)
This commit is contained in:
parent
15b0371eb2
commit
79b0739ba2
1 changed files with 9 additions and 8 deletions
|
@ -208,14 +208,15 @@ def read_interfaces_lines(module, line_strings):
|
||||||
"down": [],
|
"down": [],
|
||||||
"post-up": []
|
"post-up": []
|
||||||
}
|
}
|
||||||
iface_name, address_family_name, method_name = words[1:4]
|
iface_name = words[1]
|
||||||
if len(words) != 4:
|
try:
|
||||||
module.fail_json(msg="Incorrect number of parameters (%d) in line %d, must be exectly 3" % (len(words), i))
|
currif['address_family'] = words[2]
|
||||||
# TODO: put line and count parameters
|
except IndexError:
|
||||||
return None, None
|
currif['address_family'] = None
|
||||||
|
try:
|
||||||
currif['address_family'] = address_family_name
|
currif['method'] = words[3]
|
||||||
currif['method'] = method_name
|
except IndexError:
|
||||||
|
currif['method'] = None
|
||||||
|
|
||||||
ifaces[iface_name] = currif
|
ifaces[iface_name] = currif
|
||||||
lines.append({'line': line, 'iface': iface_name, 'line_type': 'iface', 'params': currif})
|
lines.append({'line': line, 'iface': iface_name, 'line_type': 'iface', 'params': currif})
|
||||||
|
|
Loading…
Reference in a new issue