mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
module: fix default value for dhcp4_send_hostname
We should not set "dhcp4_send_hostname" unless it is explicitly present in the configuration. That is because initscripts don't support this parameter and issue a warning.
This commit is contained in:
parent
cd2030cde6
commit
d88e79ac8c
2 changed files with 2 additions and 4 deletions
|
|
@ -619,9 +619,7 @@ class ArgValidator_DictIP(ArgValidatorDict):
|
|||
result['dhcp4'] = result['dhcp4_send_hostname'] is not None or not any([a for a in result['address'] if a['is_v4']])
|
||||
if result['auto6'] is None:
|
||||
result['auto6'] = not any([a for a in result['address'] if not a['is_v4']])
|
||||
if result['dhcp4_send_hostname'] is None:
|
||||
result['dhcp4_send_hostname'] = False
|
||||
else:
|
||||
if result['dhcp4_send_hostname'] is not None:
|
||||
if not result['dhcp4']:
|
||||
raise ValidationError(name, '"dhcp4_send_hostname" is only valid if "dhcp4" is enabled')
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ class TestValidator(unittest.TestCase):
|
|||
'dns_search': [ 'aa', 'bb' ],
|
||||
'route_metric6': None,
|
||||
'ip_is_present': True,
|
||||
'dhcp4_send_hostname': False,
|
||||
'dhcp4_send_hostname': None,
|
||||
},
|
||||
'mac': None,
|
||||
'master': None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue