#NEWLINE# @ staticmethod #NEWLINE# def _device_to_port_id( context , device ) : #NEWLINE# #INDENT# for prefix in n_const . INTERFACE_PREFIXES : #NEWLINE# #INDENT# if device . startswith ( prefix ) : #NEWLINE# #INDENT# return device [ len ( prefix ) : ] #NEWLINE# #UNINDENT# #UNINDENT# if ( not uuidutils . is_uuid_like ( device ) ) : #NEWLINE# #INDENT# port = db . get_port_from_device_mac ( context , device ) #NEWLINE# if port : #NEWLINE# #INDENT# return port . id #NEWLINE# #UNINDENT# #UNINDENT# return device