Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mark Schouten
ypconfig
Commits
aa41502c
Commit
aa41502c
authored
Mar 23, 2017
by
Mark Schouten
Browse files
Complain about invalid fields in configuration
parent
5df45d28
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/ypconfig/Config.py
View file @
aa41502c
...
...
@@ -106,6 +106,11 @@ def Validate(document):
raise
ValueError
(
"Invalid value for lacp_rate"
)
def
Interface
(
iface
,
iname
):
known_fields
=
[
'description'
,
'name'
,
'addresses'
,
'adminstate'
,
'mtu'
,
'ratelimit'
,
'slaves'
,
'type'
,
'vlanid'
,
'parent'
,
'bond-mode'
,
'miimon'
,
'lacp_rate'
]
for
f
in
iface
.
keys
():
if
f
not
in
known_fields
:
raise
ValueError
(
"Invalid field in config for interface %s: %s"
%
(
iname
,
f
))
ret
=
{}
ret
[
'name'
]
=
iname
if
iname
==
'lo'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment