diff --git a/library/network_connections.py b/library/network_connections.py index 123251c..9c7e8c3 100755 --- a/library/network_connections.py +++ b/library/network_connections.py @@ -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 diff --git a/library/test_network_connections.py b/library/test_network_connections.py index 5a8029c..d7c7afc 100755 --- a/library/test_network_connections.py +++ b/library/test_network_connections.py @@ -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,