mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Support reading multiple addresses from interface files.
This commit is contained in:
parent
15c34fe7a2
commit
622c354683
@ -629,7 +629,12 @@ def _parse_interfaces(interface_files=None):
|
||||
attrname = attr
|
||||
(valid, value, errmsg) = _validate_interface_option(
|
||||
attr, valuestr, addrfam)
|
||||
iface_dict[attrname] = value
|
||||
if attrname == 'address' and 'address' in iface_dict:
|
||||
if 'addresses' not in iface_dict:
|
||||
iface_dict['addresses'] = []
|
||||
iface_dict['addresses'].append(value)
|
||||
else:
|
||||
iface_dict[attrname] = value
|
||||
|
||||
elif attr in _REV_ETHTOOL_CONFIG_OPTS:
|
||||
if 'ethtool' not in iface_dict:
|
||||
@ -1710,11 +1715,6 @@ def build_interface(iface, iface_type, enabled, **settings):
|
||||
if 'proto' not in settings:
|
||||
settings['proto'] = 'static'
|
||||
|
||||
if 'ipv6ipaddr' not in settings and 'ipv6ipaddrs' in settings:
|
||||
settings['ipv6ipaddr'] = settings['ipv6ipaddrs'].pop(0)
|
||||
if 'ipaddr' not in settings and 'ipaddrs' in settings:
|
||||
settings['ipaddr'] = settings['ipaddrs'].pop(0)
|
||||
|
||||
if iface_type == 'slave':
|
||||
settings['slave'] = 'yes'
|
||||
if 'master' not in settings:
|
||||
|
Loading…
Reference in New Issue
Block a user