Skip to content

Commit 0b63beb

Browse files
committed
Network olso events do not specify network_type and suchlike
removing code for handling these attributes because they dont contain the data that I thought they did.
1 parent 01b943a commit 0b63beb

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

python/understack-workflows/understack_workflows/oslo_event/neutron_network.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ class NetworkEvent:
2121
network_name: str
2222
tenant_id: UUID
2323
external: bool
24-
network_type: str | None
25-
physical_network: str | None
26-
segmentation_id: int | None
2724

2825
@classmethod
2926
def from_event_dict(cls, data: dict) -> Self:
@@ -34,9 +31,6 @@ def from_event_dict(cls, data: dict) -> Self:
3431
network["name"],
3532
UUID(network["project_id"]),
3633
bool(network["router:external"]),
37-
network["provider:network_type"],
38-
network["provider:physical_network"],
39-
network["provider:segmentation_id"],
4034
)
4135

4236

@@ -46,9 +40,6 @@ def handle_network_create_or_update(
4640
"""Handle Openstack Neutron Network CRUD Event."""
4741
event = NetworkEvent.from_event_dict(event_data)
4842

49-
if event.network_type not in APPLICABLE_NETWORK_TYPES:
50-
return 0
51-
5243
_ensure_nautobot_ipam_namespace_exists(nautobot, str(event.network_uuid))
5344
_create_nautobot_ucvni(nautobot, event, ucvni_group_name)
5445

@@ -59,9 +50,6 @@ def handle_network_delete(_conn, nautobot: Nautobot, event_data: dict) -> int:
5950
"""Handle Openstack Neutron Network CRUD Event."""
6051
event = NetworkEvent.from_event_dict(event_data)
6152

62-
if event.network_type not in APPLICABLE_NETWORK_TYPES:
63-
return 0
64-
6553
_delete_nautobot_ipam_namespace(nautobot, str(event.network_uuid))
6654
_delete_nautotbot_ucvni(nautobot, id=str(event.network_uuid))
6755

@@ -84,7 +72,6 @@ def _create_nautobot_ucvni(
8472
"status": {"name": "Active"},
8573
"tenant": str(event.tenant_id),
8674
"ucvni_group": {"name": ucvni_group_name},
87-
"ucvni_id": event.segmentation_id,
8875
}
8976
try:
9077
response = nautobot.plugins.undercloud_vni.ucvnis.create(payload)

0 commit comments

Comments
 (0)