@@ -302,15 +302,16 @@ def client_kill(self, address):
302
302
return self .execute_command ('CLIENT KILL' , address )
303
303
304
304
def client_kill_filter (self , _id = None , _type = None , addr = None ,
305
- skipme = None , laddr = None ):
305
+ skipme = None , laddr = None , user = None ):
306
306
"""
307
307
Disconnects client(s) using a variety of filter options
308
308
:param id: Kills a client by its unique ID field
309
309
:param type: Kills a client by type where type is one of 'normal',
310
310
'master', 'slave' or 'pubsub'
311
311
:param addr: Kills a client by its 'address:port'
312
312
:param skipme: If True, then the client calling the command
313
- :param laddr: Kills a cient by its 'local (bind) address:port'
313
+ :param laddr: Kills a client by its 'local (bind) address:port'
314
+ :param user: Kills a client for a specific user name
314
315
will not get killed even if it is identified by one of the filter
315
316
options. If skipme is not provided, the server defaults to skipme=True
316
317
"""
@@ -334,6 +335,8 @@ def client_kill_filter(self, _id=None, _type=None, addr=None,
334
335
args .extend ((b'ADDR' , addr ))
335
336
if laddr is not None :
336
337
args .extend ((b'LADDR' , laddr ))
338
+ if user is not None :
339
+ args .extend ((b'USER' , user ))
337
340
if not args :
338
341
raise DataError ("CLIENT KILL <filter> <value> ... ... <filter> "
339
342
"<value> must specify at least one filter" )
@@ -346,7 +349,7 @@ def client_info(self):
346
349
"""
347
350
return self .execute_command ('CLIENT INFO' )
348
351
349
- def client_list (self , _type = None , client_id = None ):
352
+ def client_list (self , _type = None , client_id = [] ):
350
353
"""
351
354
Returns a list of currently connected clients.
352
355
If type of client specified, only that type will be returned.
@@ -362,9 +365,11 @@ def client_list(self, _type=None, client_id=None):
362
365
client_types ,))
363
366
args .append (b'TYPE' )
364
367
args .append (_type )
365
- if client_id is not None :
368
+ if not isinstance (client_id , list ):
369
+ raise DataError ("client_id must be a list" )
370
+ if client_id != []:
366
371
args .append (b"ID" )
367
- args .append (client_id )
372
+ args .append (' ' . join ( client_id ) )
368
373
return self .execute_command ('CLIENT LIST' , * args )
369
374
370
375
def client_getname (self ):
0 commit comments