#NEWLINE# def _get_node_id( self , ports ) : #NEWLINE# #INDENT# "Get a node ID for a list of ports.\n\n        Given a list of ports, either return the node_id they all share or\n        raise a NotFound if there are multiple node_ids, which indicates some\n        ports are connected to one node and the remaining port(s) are connected\n        to one or more other nodes.\n\n        :raises: NodeNotFound if the MACs match multiple nodes. This\n        could happen if you swapped a NIC from one server to another and\n        don't notify Ironic about it or there is a MAC collision (since\n        they're not guaranteed to be unique).\n        " #NEWLINE# node_ids = set ( ( port_ob . node_id for port_ob in ports ) ) #NEWLINE# if ( len ( node_ids ) > 1 ) : #NEWLINE# #INDENT# raise exception . NodeNotFound ( ( _ ( 'Ports matching mac addresses match multiple nodes. MACs: %(macs)s. Port ids: %(port_ids)s' ) % { #NEWLINE# #INDENT# 'macs' : [ port_ob . address for port_ob in ports ] , #NEWLINE# 'port_ids' : [ port_ob . uuid for port_ob in ports ] , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# return node_ids . pop ( )