#NEWLINE# def _add_service( self , grpname , srvr_ip , srvr_port ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# bindings = servicegroup_servicegroupmember_binding . get ( self . ns_session , grpname ) #NEWLINE# for binding in bindings : #NEWLINE# #INDENT# if ( ( binding . ip == srvr_ip ) and ( str ( binding . port ) == bindings ) ) : #NEWLINE# #INDENT# logger . info ( ( 'Service %s:%s is already bound to service                                 group %s ' % ( srvr_ip , srvr_port , grpname ) ) ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except nitro_exception as e : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# binding = servicegroup_servicegroupmember_binding ( ) #NEWLINE# binding . servicegroupname = grpname #NEWLINE# binding . ip = srvr_ip #NEWLINE# binding . port = srvr_port #NEWLINE# servicegroup_servicegroupmember_binding . add ( self . ns_session , binding )