From 0ca86c9dbd3c042a8a357a4e3e8fedd433174830 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 Jan 2018 13:18:26 +0100 Subject: [PATCH] library: reject setting 'zone' for slave types --- library/network_connections.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/network_connections.py b/library/network_connections.py index 4fcec85..2db3737 100755 --- a/library/network_connections.py +++ b/library/network_connections.py @@ -880,6 +880,12 @@ class ArgValidator_DictConnection(ArgValidatorDict): if 'master' not in result: result['ip'] = self.nested['ip'].get_default_value() + if 'zone' in result: + if 'master' in result: + raise ValidationError(name + '.zone', '"zone" cannot be configured for slave types') + else: + result['zone'] = None + if 'mac' in result: if result['type'] not in [ 'ethernet', 'infiniband' ]: raise ValidationError(name + '.mac', 'a "mac" address is only allowed for type "ethernet" or "infiniband"')