#NEWLINE# def get_vm_detach_port_index( session , vm_ref , iface_id ) : #NEWLINE# #INDENT# extra_config = session . _call_method ( vutil , 'get_object_property' , iface_id , 'config.extraConfig' ) #NEWLINE# if ( extra_config is not None ) : #NEWLINE# #INDENT# options = extra_config . OptionValue #NEWLINE# for option in options : #NEWLINE# #INDENT# if ( option . key . startswith ( 'nvp.iface-id.' ) and ( option . value == iface_id ) ) : #NEWLINE# #INDENT# return int ( option . key . split ( '.' ) [ 2 ] )