#NEWLINE# def replace( key , value , host = DEFAULT_HOST , port = DEFAULT_PORT , time = DEFAULT_TIME , min_compress_len = DEFAULT_MIN_COMPRESS_LEN ) : #NEWLINE# #INDENT# "\n    Replace a key on the memcached server. This only succeeds if the key\n    already exists. This is the opposite of :mod:`memcached.add\n    <salt.modules.memcached.add>`\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' memcached.replace <key> <value>\n    " #NEWLINE# if ( not isinstance ( time , integer_types ) ) : #NEWLINE# #INDENT# raise SaltInvocationError ( "'time' must be an integer" ) #NEWLINE# #UNINDENT# if ( not isinstance ( host , integer_types ) ) : #NEWLINE# #INDENT# raise SaltInvocationError ( "'min_compress_len' must be an integer" ) #NEWLINE# #UNINDENT# conn = _connect ( host , port ) #NEWLINE# stats = conn . get_stats ( ) #NEWLINE# return conn . replace ( key , value , time = time , min_compress_len = min_compress_len )