Skip to content

[dhcp_server] add show range cli#17262

Merged
yxieca merged 11 commits intosonic-net:masterfrom
Xichen96:dev/xichenlin/dhcp_server_show_ranges
Dec 7, 2023
Merged

[dhcp_server] add show range cli#17262
yxieca merged 11 commits intosonic-net:masterfrom
Xichen96:dev/xichenlin/dhcp_server_show_ranges

Conversation

@Xichen96
Copy link
Contributor

Why I did it

Need show range to show dhcp_server range setting.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Add cli

How to verify it

Run unit test

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)

master image from #17051

Description for the changelog

Add show range to dhcp_server 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 November 22, 2023 05:54
dbconn = db.db
for key in dbconn.keys("CONFIG_DB", "DHCP_SERVER_IPV4_RANGE|" + range_name):
entry = dbconn.get_all("CONFIG_DB", key)
start, end = entry["range"].split(",")
Copy link
Contributor

@yaqiangz yaqiangz Nov 23, 2023

Choose a reason for hiding this comment

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

We need check to make sure length of valid range list is 1 or 2. If range only contain 1 ip, treat it as a valid range with same start and end
(closed)

@Blueve
Copy link
Contributor

Blueve commented Dec 7, 2023

@yxieca could you help merge this PR?

@yxieca yxieca merged commit 5992765 into sonic-net:master Dec 7, 2023
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.

5 participants