Skip to content

Conversation

@saket-geant
Copy link
Contributor

resolves #64

Comment on lines 113 to 118
@step("Validate VLAN selection")
def validate_vlan_selection(ports: list[UUIDstr], vlan: VlanRanges) -> State:
info = SimpleNamespace(data={"ports": ports})
validated_vlan = validate_vlan(vlan, info)
validate_vlan_not_in_use(validated_vlan, info, port_field_name="ports")
return {"ports": ports, "vlan": validated_vlan}
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this validation add on top of the same validation in the form generator?

if sap.port.ims_id is None:
raise ValueError("Port IMS id missing; cannot associate VLANs")
sap.ims_id = sap.port.ims_id
vlan_payloads += build_sap_vlans_payload(sap, subscription)
Copy link
Contributor

Choose a reason for hiding this comment

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

For L2VPN the vlan groups should still be administered in IMS.

The "do not administrate VLAN group in Netbox, VLAN administration is only done in the orchestrator database" requirement only applies to NSISTP product/workflows (which is written above the summary, maybe that's the source of the confusion)

Comment on lines 46 to 47
if vlan.vid in target_vlans:
netbox.delete_vlan(id=vlan.id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed for a specific reason?

Copy link
Contributor

@Mark90 Mark90 left a comment

Choose a reason for hiding this comment

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

LGTM

@Mark90 Mark90 merged commit 26601f2 into master Jan 13, 2026
2 checks passed
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.

[Refactor]: Fix NSISTP and VLAN validation

3 participants