#NEWLINE# def server_update( s_name , s_ip , **connection_args ) : #NEWLINE# #INDENT# "\n    Update a server's attributes\n\n    CLI Example:\n\n    .. code-block:: bash\n\n      salt '*' netscaler.server_update 'serverName' 'serverIP'\n    " #NEWLINE# altered = False #NEWLINE# cur_server = _server_get ( s_name , ** connection_args ) #NEWLINE# if ( cur_server is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# alt_server = NSServer ( ) #NEWLINE# alt_server . set_name ( s_ip ) #NEWLINE# if ( cur_server . get_ipaddress ( ) != s_ip ) : #NEWLINE# #INDENT# alt_server . set_ipaddress ( s_ip ) #NEWLINE# altered = True #NEWLINE# #UNINDENT# if ( altered is False ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# nitro = _connect ( ** connection_args ) #NEWLINE# if ( nitro is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# ret = True #NEWLINE# try : #NEWLINE# #INDENT# NSServer . update ( nitro , alt_server ) #NEWLINE# #UNINDENT# except NSNitroError as error : #NEWLINE# #INDENT# log . debug ( 'netscaler module error - NSServer.update() failed: {0}' . format ( error ) ) #NEWLINE# ret = False #NEWLINE# #UNINDENT# _disconnect ( nitro ) #NEWLINE# return ret