Skip to content
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

[dhcp_server] add config dhcp server option #18013

Merged

Conversation

Xichen96
Copy link
Contributor

@Xichen96 Xichen96 commented Feb 2, 2024

Add config dhcp_server option cli.

Why I did it

Add config dhcp_server option cli.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Add function to config plugin

How to verify it

Run unittests

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Add config dhcp_server option cli

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

option id is uint8 rather than uint32. And currently we only support customizing unassigned options, which refer to https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_option.csv

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#Closed

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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supported type:

SUPPORT_TYPE = ["binary", "boolean", "ipv4-address", "string", "uint8", "uint16", "uint32"]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#Closed

@Xichen96
Copy link
Contributor Author

Xichen96 commented Feb 4, 2024

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@Xichen96
Copy link
Contributor Author

Xichen96 commented Feb 4, 2024

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@Xichen96
Copy link
Contributor Author

Xichen96 commented Feb 6, 2024

@yxieca Hi Ying, please help take a look

@yxieca yxieca merged commit 2244aa2 into sonic-net:master Feb 22, 2024
19 checks passed
sonic-otn pushed a commit to Weitang-Zheng/sonic-buildimage that referenced this pull request Mar 11, 2024
saksarav-nokia pushed a commit to saksarav-nokia/sonic-buildimage that referenced this pull request Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants