Skip to content

[dhcp_server] add config dhcp server option#18013

Merged
yxieca merged 20 commits intosonic-net:masterfrom
Xichen96:dev/xichenlin/add-config-dhcp-server-option
Feb 22, 2024
Merged

[dhcp_server] add config dhcp server option#18013
yxieca merged 20 commits intosonic-net:masterfrom
Xichen96:dev/xichenlin/add-config-dhcp-server-option

Conversation

@Xichen96
Copy link
Copy Markdown
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)

@Xichen96 Xichen96 requested a review from lguohan as a code owner February 2, 2024 16:32
@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Xichen96 commented Feb 4, 2024

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

Xichen96 commented Feb 4, 2024

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

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
Copy Markdown
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
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