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

dhcpv6-server: T5992: Fix op-mode Kea DHCP lease output #4221

Merged
merged 15 commits into from
Dec 23, 2024

Conversation

nvandamme
Copy link
Contributor

@nvandamme nvandamme commented Dec 4, 2024

Change Summary

Fixing for op commands:

  • show dhcpv6 server static-mappings to include ipv6-address from actual dhcpv6 static mappings in config.
  • show dhcpv6 server leases to include hostname field (and removing trailing dot if any).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Related Task(s)

Related PR(s)

Component(s) name

  • dhcpv6-server

Proposed changes

  • Fix reading of ipv6-address field in config section service dhcpv6-server [...] static-mapping to report them in op command show dhcpv6 server static-mappings
  • Fix reading of hostname field in leases for either show dhcp server leases / show dhcpv6 server leases op commands
  • Fix sort arg in show dhcpv6 server [...] op commands

How to test

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Dec 4, 2024


PR title does not match the required format

Copy link
Member

@sarthurdev sarthurdev left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

While small fixes relating to the same area of code as the PR targets are usually no problem, each fix should be in separate commits with an identifying commit message.

The commits in this PR all have the same commit message, despite changing different things. Can you please reword the messages for what each commit changes?

duid = entry.get('duid', 'N/A')
description = entry.get('description', 'N/A')
data_entries.append([pool, subnet, name, ip_addr, mac_addr, duid, description])
elif family == 'inet6':
Copy link
Member

Choose a reason for hiding this comment

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

Instead of duplicating all these lines for the one ipv6-address key difference. Could this instead be handled by:
ip_addr = entry.get('ipv6-address' if family == 'inet6' else 'ip-address', 'N/A')

Copy link
Contributor Author

@nvandamme nvandamme Dec 6, 2024

Choose a reason for hiding this comment

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

Of course, normally i'll be doing so, but most part of handling code inside the same file has been split for the two inet families, given their formatting headers have not the same labels:

# IPv4 header for `show dhcp server leases`
headers = ['IP Address', 'MAC address', 'State', 'Lease start', 'Lease expiration', 'Remaining', 'Pool',
                   'Hostname', 'Origin']

# IPv6 header for `show dhcpv6 server leases`
headers = ['IPv6 address', 'State', 'Last communication', 'Lease expiration', 'Remaining', 'Type', 'Pool',
                   'DUID']

Copy link
Member

Choose a reason for hiding this comment

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

Could this instead be handled by: ip_addr = entry.get('ipv6-address' if family == 'inet6' else 'ip-address', 'N/A')

We need room for future improvements, too ;)

src/op_mode/dhcp.py Show resolved Hide resolved
@nvandamme
Copy link
Contributor Author

Thanks for the PR.

While small fixes relating to the same area of code as the PR targets are usually no problem, each fix should be in separate commits with an identifying commit message.

The commits in this PR all have the same commit message, despite changing different things. Can you please reword the messages for what each commit changes?

Not used to amend commit message, does these renaming works ?

Copy link

github-actions bot commented Dec 6, 2024

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@c-po c-po requested a review from sarthurdev December 17, 2024 19:12
@c-po
Copy link
Member

c-po commented Dec 23, 2024

Commits will be squashed and merged

@c-po c-po dismissed sarthurdev’s stale review December 23, 2024 09:02

Will be addressed in separate commit potentially combining all address family sections

@c-po c-po merged commit 3168305 into vyos:current Dec 23, 2024
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants