3636_RECONCILE_PROVISION_TIMEOUT = 60
3737_PANOS_DRIVER = "panos"
3838_ROUTER_RELEASE_MARKER = "understack_router_release" # release is in progress
39- # 1. Ironic TBN trait of a node whose ports carry roles (category "outside" / "inside")
40- # 2. enroll-fw adds it to the node
41- # 3. adoption copies it into instance_info.traits, which is what makes Ironic apply the
42- # matching rule in cm-trait-based-networking.yaml
39+ # Enrollment sets the node trait; adoption activates its TBN rule.
4340ROLE_ATTACH_TRAIT = "CUSTOM_NETDEV_ROLE_ATTACH"
4441_TENANT_VIF_KEY = "tenant_vif_port_id"
4542
@@ -186,13 +183,7 @@ def attach_vif_to_node(
186183 * ,
187184 tags : list [str ] | None = None ,
188185 ) -> None :
189- """Attach a Neutron port (VIF) to the node.
190-
191- tags go in the attach request as vif_info['tags'], which Ironic's trait-based
192- networking matches as network.tags
193- Todo: Today The SDK call cannot send them, so a tagged attach posts
194- the same request itself.
195- """
186+ """Attach a VIF, forwarding optional role tags to Ironic's TBN rules."""
196187 node_id = node .id if isinstance (node , BaremetalNode ) else node
197188 if not tags :
198189 LOG .info ("Attaching VIF %s to Ironic node %s" , vif_id , node_id )
@@ -202,8 +193,7 @@ def attach_vif_to_node(
202193 LOG .info (
203194 "Attaching VIF %s to Ironic node %s with tags %s" , vif_id , node_id , tags
204195 )
205- # Same version and retries as the SDK's Node.attach_vif: a 409 usually
206- # means the node is locked, not that the VIF is in use.
196+ # The SDK cannot send VIF tags; post directly with its retry policy.
207197 response = self .irclient .post (
208198 f"/nodes/{ node_id } /vifs" ,
209199 json = {"id" : vif_id , "tags" : list (tags )},
0 commit comments