Skip to content

Commit 545729f

Browse files
committed
fix: keystone expects the project id without dashes
1 parent 83b9131 commit 545729f

File tree

1 file changed

+8
-1
lines changed
  • python/understack-workflows/understack_workflows/oslo_event

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from openstack.connection import Connection
55
from pydantic import BaseModel
6+
from pydantic import computed_field
67
from pynautobot.core.api import Api as Nautobot
78

89
from understack_workflows.helpers import save_output
@@ -37,13 +38,19 @@ def from_event_dict(cls, data: dict) -> Self:
3738
node_uuid=payload_data["uuid"],
3839
)
3940

41+
@computed_field
42+
@property
43+
def lessee_undashed(self) -> str:
44+
"""Returns lessee without dashes."""
45+
return self.lessee.hex
46+
4047

4148
def handle_provision_end(conn: Connection, _: Nautobot, event_data: dict) -> int:
4249
"""Operates on an Ironic Node provisioning END event."""
4350
# Check if the project is configured with tags.
4451
event = IronicProvisionSetEvent.from_event_dict(event_data)
4552
logger.info("Checking if project %s is tagged with UNDERSTACK_SVM", event.lessee)
46-
if not is_project_svm_enabled(conn, event.lessee):
53+
if not is_project_svm_enabled(conn, event.lessee_undashed):
4754
return 0
4855

4956
# Check if the server instance has an appropriate property.

0 commit comments

Comments
 (0)