-
Notifications
You must be signed in to change notification settings - Fork 335
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: T6611: add vendor support for ShoreTel IP phones #3884
base: current
Are you sure you want to change the base?
Conversation
❌ |
✅ No issues found in unused-imports check.. Please refer the workflow run |
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.
Missing logic to add the option in Kea config, see here: https://github.com/vyos/vyos-1x/blob/current/python/vyos/kea.py#L94
Also please include the option in a dhcp server smoketest to validate the functionality: https://github.com/vyos/vyos-1x/blob/current/smoketest/scripts/cli/test_service_dhcp-server.py#L159
I flubbed the commit message when I merged current and the build seems to be failing in unrelated areas. The smokes succeeded so I think everything is there. Should I amend the message and push again or just leave it be? |
CI integration ❌ failed! Details
|
Thanks for the changes, this is looking good. Have you tested a build to ensure the option works as intended? |
Haven't gotten there yet. I'll be offline for about a week so won't be able to revisit until after that. |
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.
Just a minor comment about help strings.
@@ -232,6 +232,25 @@ | |||
</leafNode> | |||
</children> | |||
</node> | |||
<node name="shoretel"> | |||
<properties> | |||
<help>Shoretel-specfic parameters</help> |
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.
I suppose we should consistently capitalize "ShoreTel" like they do in their branding.
Good point. I'll merge that in, do a build and then test.
…On Fri, Aug 2, 2024 at 8:32 AM Daniil Baturin ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Just a minor comment about help strings.
------------------------------
In interface-definitions/include/dhcp/option-v4.xml.i
<#3884 (comment)>:
> @@ -232,6 +232,25 @@
</leafNode>
</children>
</node>
+ <node name="shoretel">
+ <properties>
+ <help>Shoretel-specfic parameters</help>
I suppose we should consistently capitalize "ShoreTel" like they do in
their branding.
—
Reply to this email directly, view it on GitHub
<#3884 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7Y6RVHQXUJGIOLFJOFP6LZPN35TAVCNFSM6AAAAABLRGBIDKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEMJVGQ4DEMJZHA>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
@Mergifyio rebase |
✅ Branch has been successfully rebased |
512f0cc
to
23fd349
Compare
Have been busy with other projects but for simplicity, the plan was to unconditionally send this option to all clients but an ISC KB shows the issue. It looks like ShoreTel chose 156 and defined it as a string before it was registered (cf. 1.1.1.1) but never told IANA. After that RFC 6926 defined 156 as an integer so Kea barfs on the redefinition if it is in the "dhcp4" (default) space. In the "shoretel" space it will not be sent unless an option 60 triggers it. Oddly (or totally expectedly) Windows DHCP server cares not a whit about this. The client class stuff is relatively easy in the Kea cfg file itself but how does the top of kea-dhcp4.conf.j2 check for a shared-network that needs the class? Seems really inefficient to kea_shared_network_json, then json.loads() the result and then check for the option. OTOH not looking to unconditionally load up client classes. I probably have the Python-fu to do a generic/abstract client class checker/handler but not sure how to do it in a VyOS-ic way. This may even be reinventing the wheel, I dont know. This is my itch to scratch so I can take on the coding but suspect I need some design guidance. Help! |
Co-authored-by: Daniil Baturin <[email protected]>
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.
Thanks for your changes, sorry for the lack of comments. The client-class is a great solution for the addition of these options only when needed.
Added few requests to get this PR in a state ready for merge.
<description>Comma-separated parameters for ShoreTel phone configuration</description> | ||
</valueHelp> | ||
<constraint> | ||
<validator name="shoretel-server"/> |
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.
Please remove the validator and instead just put the regex in the XML instead.
Example here: https://github.com/vyos/vyos-1x/blob/current/interface-definitions/firewall.xml.in#L14
@@ -114,6 +115,13 @@ def kea_parse_subnet(subnet, config): | |||
if 'bootfile_server' in config['option']: | |||
out['next-server'] = config['option']['bootfile_server'] | |||
|
|||
if kea_client_classes(config): | |||
if kea_client_classes(config,'shoretel'): |
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.
This should be optimised so the kea_client_classes
is not needing to be called twice.
@@ -138,6 +146,13 @@ def kea_parse_subnet(subnet, config): | |||
if 'bootfile_server' in range_config['option']: | |||
pool['next-server'] = range_config['option']['bootfile_server'] | |||
|
|||
if kea_client_classes(config): | |||
if kea_client_classes(config,'shoretel'): |
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.
This should be optimised so the kea_client_classes
is not needing to be called twice.
@@ -169,6 +184,13 @@ def kea_parse_subnet(subnet, config): | |||
if 'bootfile_server' in host_config['option']: | |||
reservation['next-server'] = host_config['option']['bootfile_server'] | |||
|
|||
if kea_client_classes(config): | |||
if kea_client_classes(config,'shoretel'): |
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.
This should be optimised so the kea_client_classes
is not needing to be called twice.
@@ -48,9 +48,9 @@ def _get_environment(location=None): | |||
loc_loader=FileSystemLoader(location) | |||
env = Environment( | |||
# Don't check if template files were modified upon re-rendering | |||
auto_reload=False, | |||
auto_reload=True, |
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.
Aren't these changes irrelevant to this PR?
@@ -871,6 +871,32 @@ def kea_high_availability_json(config): | |||
|
|||
return dumps(data) | |||
|
|||
@register_filter('kea_client_classes') |
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.
As not used in any Jinja templates, this doesn't need to be registered.
@@ -897,12 +923,20 @@ def kea_shared_network_json(shared_networks): | |||
if 'bootfile_server' in config['option']: | |||
network['next-server'] = config['option']['bootfile_server'] | |||
|
|||
if kea_client_classes(config): | |||
if kea_client_classes(config, 'shoretel'): |
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.
This should be optimised so the kea_client_classes
is not needing to be called twice.
if 'subnet' in config: | ||
for subnet, subnet_config in config['subnet'].items(): | ||
if 'disable' in subnet_config: | ||
continue | ||
network['subnet4'].append(kea_parse_subnet(subnet, subnet_config)) | ||
|
||
if kea_client_classes(subnet_config): | ||
if kea_client_classes(subnet_config, 'shoretel'): |
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.
This should be optimised so the kea_client_classes
is not needing to be called twice.
Hi Simon,
Thanks for the feedback. I am not going to be able to revisit this soon and
am thinking it needs to be refactored to handle client-class generally
(defining classes, match criteria, etc.). So staying under the option >
vendor-option interface would be client-class with options for name and
test. The test would probably need to be a simple "startswith"-type match
at first. Havent thought thru this much beyond that.
So ... I want to keep this hanging over my head since we want to get to 1.5
once it is certified for DellEMC but I dont want to keep it as a nuisance
for anyone maintaining. Let me know if its better to close this out and
start again or if I can keep it queued for myself.
Thanks,
Bill
…On Mon, Sep 23, 2024 at 8:02 AM Simon ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Thanks for your changes, sorry for the lack of comments. The client-class
is a great solution for the addition of these options only when needed.
Added few requests to get this PR in a state ready for merge.
------------------------------
In interface-definitions/include/dhcp/option-v4.xml.i
<#3884 (comment)>:
> @@ -232,6 +232,25 @@
</leafNode>
</children>
</node>
+ <node name="shoretel">
+ <properties>
+ <help>ShoreTel-specfic parameters</help>
+ </properties>
+ <children>
+ <leafNode name="shoretel-server">
+ <properties>
+ <help>ShoreTel phone configuration</help>
+ <valueHelp>
+ <format>text</format>
+ <description>Comma-separated parameters for ShoreTel phone configuration</description>
+ </valueHelp>
+ <constraint>
+ <validator name="shoretel-server"/>
Please remove the validator and instead just put the regex in the XML
instead.
Example here:
https://github.com/vyos/vyos-1x/blob/current/interface-definitions/firewall.xml.in#L14
------------------------------
In python/vyos/kea.py
<#3884 (comment)>:
> @@ -114,6 +115,13 @@ def kea_parse_subnet(subnet, config):
if 'bootfile_server' in config['option']:
out['next-server'] = config['option']['bootfile_server']
+ if kea_client_classes(config):
+ if kea_client_classes(config,'shoretel'):
This should be optimised so the kea_client_classes is not needing to be
called twice.
------------------------------
In python/vyos/kea.py
<#3884 (comment)>:
> @@ -138,6 +146,13 @@ def kea_parse_subnet(subnet, config):
if 'bootfile_server' in range_config['option']:
pool['next-server'] = range_config['option']['bootfile_server']
+ if kea_client_classes(config):
+ if kea_client_classes(config,'shoretel'):
This should be optimised so the kea_client_classes is not needing to be
called twice.
------------------------------
In python/vyos/kea.py
<#3884 (comment)>:
> @@ -169,6 +184,13 @@ def kea_parse_subnet(subnet, config):
if 'bootfile_server' in host_config['option']:
reservation['next-server'] = host_config['option']['bootfile_server']
+ if kea_client_classes(config):
+ if kea_client_classes(config,'shoretel'):
This should be optimised so the kea_client_classes is not needing to be
called twice.
------------------------------
In python/vyos/template.py
<#3884 (comment)>:
> @@ -48,9 +48,9 @@ def _get_environment(location=None):
loc_loader=FileSystemLoader(location)
env = Environment(
# Don't check if template files were modified upon re-rendering
- auto_reload=False,
+ auto_reload=True,
Aren't these changes irrelevant to this PR?
------------------------------
In python/vyos/template.py
<#3884 (comment)>:
> @@ -871,6 +871,32 @@ def kea_high_availability_json(config):
return dumps(data)
***@***.***_filter('kea_client_classes')
As not used in any Jinja templates, this doesn't need to be registered.
------------------------------
In python/vyos/template.py
<#3884 (comment)>:
> @@ -897,12 +923,20 @@ def kea_shared_network_json(shared_networks):
if 'bootfile_server' in config['option']:
network['next-server'] = config['option']['bootfile_server']
+ if kea_client_classes(config):
+ if kea_client_classes(config, 'shoretel'):
This should be optimised so the kea_client_classes is not needing to be
called twice.
------------------------------
In python/vyos/template.py
<#3884 (comment)>:
> if 'subnet' in config:
for subnet, subnet_config in config['subnet'].items():
if 'disable' in subnet_config:
continue
network['subnet4'].append(kea_parse_subnet(subnet, subnet_config))
+ if kea_client_classes(subnet_config):
+ if kea_client_classes(subnet_config, 'shoretel'):
This should be optimised so the kea_client_classes is not needing to be
called twice.
—
Reply to this email directly, view it on GitHub
<#3884 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7Y6RRSGMBM3R57GUNPMIDZX77MFAVCNFSM6AAAAABLRGBIDKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMRRHE3DCNZXG4>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Feel free to get to this when you can. Thanks |
Change Summary
Add ShoreTel support to dhcp
Types of changes
Related Task(s)
Related PR(s)
Component(s) name
dhcp
Proposed changes
update KEA initial conf and interface def
How to test
Smoketest result
Checklist: