mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-21 02:11:23 +00:00
library: reject setting 'zone' for slave types
This commit is contained in:
parent
1df778917e
commit
0ca86c9dbd
1 changed files with 6 additions and 0 deletions
|
|
@ -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"')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue