Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python/neutron-understack/neutron_understack/ironic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from openstack import exceptions as sdk_exc
from openstack.baremetal.baremetal_service import BaremetalService
from openstack.baremetal.v1.node import Node as BaremetalNode
from openstack.baremetal.v1.port import Port as BaremetalPort
from oslo_config import cfg

from neutron_understack import config
Expand Down Expand Up @@ -178,6 +179,11 @@ def node_vif_ids(self, node: str | BaremetalNode) -> list[str]:
"""Return the Neutron port (VIF) ids currently attached to the node."""
return self.irclient.list_node_vifs(node)

def node_ports(self, node: str | BaremetalNode) -> list[BaremetalPort]:
"""Return the node's baremetal ports, including their network fields."""
node_id = node.id if isinstance(node, BaremetalNode) else node
return list(self.irclient.ports(details=True, node_id=node_id))

def adopt_node_for_router(
self,
node: str | BaremetalNode,
Expand Down
Loading
Loading