Skip to content

Commit

Permalink
add delete port for provisioning and inspect binding levels
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Fencik committed Nov 28, 2024
1 parent 75c6ca2 commit 46f06cf
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ def update_port_postcommit(self, context):
log_call("update_port_postcommit", context)
print("Original context: ")
pprint(context.original)
print("Binding levels: ")
pprint(context.binding_levels)

vif_type = context.current["binding:vif_type"]

Expand All @@ -234,6 +236,21 @@ def delete_port_precommit(self, context):
def delete_port_postcommit(self, context):
log_call("delete_port_postcommit", context)

network_id = context.current["network_id"]

if network_id == cfg.CONF.ml2_type_understack.provisioning_network:
connected_interface_uuid = self.fetch_connected_interface_uuid(context)
port_status = "Active"
configure_port_status_data = self.nb.configure_port_status(
connected_interface_uuid, port_status
)
switch_uuid = configure_port_status_data.get("device", {}).get("id")
nb_vlan_group_id = UUID(self.nb.fetch_vlan_group_uuid(switch_uuid))
self.undersync.sync_devices(
vlan_group_uuids=str(nb_vlan_group_id),
dry_run=cfg.CONF.ml2_understack.undersync_dry_run,
)

def bind_port(self, context):
log_call("bind_port", context)
for segment in context.network.network_segments:
Expand Down

0 comments on commit 46f06cf

Please sign in to comment.