Skip to content

feat: add network segment range extension to networking v2#3614

Open
cardoe wants to merge 1 commit intogophercloud:mainfrom
cardoe:neutron-network-segment-range
Open

feat: add network segment range extension to networking v2#3614
cardoe wants to merge 1 commit intogophercloud:mainfrom
cardoe:neutron-network-segment-range

Conversation

@cardoe
Copy link
Copy Markdown
Contributor

@cardoe cardoe commented Jan 27, 2026

Add support for Neutron's network segment range extension to the networking/v2 module.

Fixes #3613

Links to the line numbers/files in the OpenStack source code that support the
code in this PR:

https://docs.openstack.org/neutron/2025.2//admin/config-network-segment-ranges.html
https://github.com/openstack/neutron/blob/master/neutron/extensions/network_segment_range.py
https://docs.openstack.org/api-ref/network/v2/index.html#network-segment-ranges

Add support for Neutron's network segment range extension to the
networking/v2 module.
@github-actions github-actions bot added edit:networking This PR updates networking code semver:minor Backwards-compatible change backport-v2 This PR will be backported to v2 labels Jan 27, 2026
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 63.91% (+0.05%) from 63.865%
when pulling 16497aa on cardoe:neutron-network-segment-range
into 01208c9 on gophercloud:main.

cardoe added a commit to cardoe/openstack-resource-controller that referenced this pull request Jan 27, 2026
Added an implementation to manage Network Segment Ranges which is a
Neutron extension.

This depends on gophercloud/gophercloud#3614. For now it pulls that in
with a replacement in go.mod.
@cardoe
Copy link
Copy Markdown
Contributor Author

cardoe commented Jan 27, 2026

The testing failure is:


Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]: Traceback (most recent call last):
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]:   File "/opt/stack/data/venv/bin/neutron-bgp-dragent", line 3, in <module>
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]:     from neutron_dynamic_routing.cmd.eventlet.agents.bgp_dragent import main
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]:   File "/opt/stack/neutron-dynamic-routing/neutron_dynamic_routing/cmd/eventlet/__init__.py", line 13, in <module>
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]:     from neutron.common import eventlet_utils
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]: ImportError: cannot import name 'eventlet_utils' from 'neutron.common' (/opt/stack/neutron/neutron/common/__init__.py)
Jan 27 18:56:17 runnervmymu0l systemd[1]: devstack@q-dr-agent.service: Main process exited, code=exited, status=1/FAILURE

Not something this code changes or touches or impacts.

@mandre
Copy link
Copy Markdown
Contributor

mandre commented Jan 28, 2026

The testing failure is:


Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]: Traceback (most recent call last):
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]:   File "/opt/stack/data/venv/bin/neutron-bgp-dragent", line 3, in <module>
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]:     from neutron_dynamic_routing.cmd.eventlet.agents.bgp_dragent import main
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]:   File "/opt/stack/neutron-dynamic-routing/neutron_dynamic_routing/cmd/eventlet/__init__.py", line 13, in <module>
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]:     from neutron.common import eventlet_utils
Jan 27 18:56:17 runnervmymu0l neutron-bgp-dragent[80592]: ImportError: cannot import name 'eventlet_utils' from 'neutron.common' (/opt/stack/neutron/neutron/common/__init__.py)
Jan 27 18:56:17 runnervmymu0l systemd[1]: devstack@q-dr-agent.service: Main process exited, code=exited, status=1/FAILURE

Not something this code changes or touches or impacts.

Yep, this is a known issue with master branch due to eventlet removal. But I now realize the patch we were waiting for merged and the job should be back to green.

Copy link
Copy Markdown
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

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

This looks great!

Would it be possible to add acceptance tests as well, to ensure the feature works as expected against a live environment?

We already configure devstack with the neutron-network-segment-range extension, so the environment should be able to handle it. That said, we should add a guard similar to what's done here:

// Skip these tests if we don't have the required extension
networking.RequireNeutronExtension(t, client, "net-mtu")

}

// NetworkSegmentRange represents a network segment range.
type NetworkSegmentRange struct {
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.

Should we add all fields? We're currently missing:

  • Description
  • TenantID (not sure this one is relevant anymore)
  • CreatedAt
  • UpdatedAt
  • RevisionNumber
  • Tags


// CreateOpts represents options for creating a network segment range.
type CreateOpts struct {
Name string `json:"name,omitempty"`
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v2 This PR will be backported to v2 edit:networking This PR updates networking code semver:minor Backwards-compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

neutron: support network segment ranges extension

3 participants