@@ -53,12 +53,9 @@ async def get_keys(
53
53
except KeyError :
54
54
# try to split the command name and to take only the main command
55
55
# e.g. 'memory' for 'memory usage'
56
- cmd_name_split = args [0 ].split ()
57
- cmd_name = cmd_name_split [0 ]
58
- if cmd_name in self .commands :
59
- # save the splitted command to args
60
- args = cmd_name_split + list (args [1 :])
61
- else :
56
+ args = args [0 ].split () + list (args [1 :])
57
+ cmd_name = args [0 ]
58
+ if cmd_name not in self .commands :
62
59
# We'll try to reinitialize the commands cache, if the engine
63
60
# version has changed, the commands may not be current
64
61
await self .initialize (redis_conn )
@@ -84,14 +81,8 @@ async def get_keys(
84
81
async def _get_moveable_keys (
85
82
self , redis_conn : "ClusterNode" , * args
86
83
) -> Optional [List [str ]]:
87
- pieces = []
88
- cmd_name = args [0 ]
89
- # The command name should be splitted into separate arguments,
90
- # e.g. 'MEMORY USAGE' will be splitted into ['MEMORY', 'USAGE']
91
- pieces = pieces + cmd_name .split ()
92
- pieces = pieces + list (args [1 :])
93
84
try :
94
- keys = await redis_conn .execute_command ("COMMAND GETKEYS" , * pieces )
85
+ keys = await redis_conn .execute_command ("COMMAND GETKEYS" , * args )
95
86
except ResponseError as e :
96
87
message = e .__str__ ()
97
88
if (
0 commit comments