-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[dhcp_server] add config dhcp server option #18013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
55c0ed1
174a65a
2ce158e
bc284a1
1b6a322
5f2b9b6
bfd3324
7232570
6b6d123
145cf99
57af1d9
dad226f
1887f8b
77217f9
638ccd6
fbde208
26cc8c0
c25d66b
010403d
adad07e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -46,6 +46,7 @@ def validate_str_type(type_, value): | |||
|
|
||||
|
|
||||
| @click.group(cls=clicommon.AbbreviationGroup, name="dhcp_server") | ||||
| @clicommon.pass_db | ||||
| def dhcp_server(): | ||||
| """config DHCP Server information""" | ||||
| ctx = click.get_current_context() | ||||
|
|
@@ -341,10 +342,98 @@ def dhcp_server_ipv4_ip_unbind(db, dhcp_interface, member_interface, range_, ip_ | |||
| ctx.fail("Attempting to unbind range or ip that is not binded") | ||||
|
|
||||
|
|
||||
| def register(cli): | ||||
| # cli.add_command(dhcp_server) | ||||
| @dhcp_server_ipv4.group(cls=clicommon.AliasedGroup, name="option") | ||||
| def dhcp_server_ipv4_option(): | ||||
| pass | ||||
|
|
||||
|
|
||||
| @dhcp_server_ipv4_option.command(name="add") | ||||
| @click.argument("option_name", required=True) | ||||
| @click.argument("option_id", required=True) | ||||
| @click.argument("type_", required=True) | ||||
| @click.argument("value", required=True) | ||||
| @clicommon.pass_db | ||||
| def dhcp_server_ipv4_option_add(db, option_name, option_id, type_, value): | ||||
| ctx = click.get_current_context() | ||||
| if not validate_str_type("uint32", option_id): | ||||
|
||||
| ctx.fail("option_id must be uint32") | ||||
| if type_ != "string": | ||||
| ctx.fail("Currently only string type is supported") | ||||
|
||||
| SUPPORT_TYPE = ["binary", "boolean", "ipv4-address", "string", "uint8", "uint16", "uint32"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#Closed
Uh oh!
There was an error while loading. Please reload this page.