@@ -12,16 +12,18 @@ def wrapper(env, *args, **kwargs):
12
12
modules = con .execute_command ("MODULE" , "LIST" )
13
13
if b'rg' in [module [1 ] for module in modules ]:
14
14
return f (env , * args , ** kwargs )
15
+ platform = paella .Platform ()
16
+ redisgears_dir = "{ROOT}/bin/{PLATFORM}/RedisGears" .format (ROOT = ROOT , PLATFORM = platform .triplet ())
17
+ if not os .path .isdir (redisgears_dir ):
18
+ env .debugPrint ("RedisGears directory does not exist" , force = True )
19
+ return
20
+ redisgears_path = os .path .join (redisgears_dir , 'redisgears.so' )
21
+ python_plugin_path = os .path .join (redisgears_dir , 'plugin/gears_python.so' )
15
22
try :
16
- platform = paella .Platform ()
17
- redisgears_dir = "{ROOT}/bin/{PLATFORM}/RedisGears" .format (ROOT = ROOT , PLATFORM = platform .triplet ())
18
- redisgears_path = os .path .join (redisgears_dir , 'redisgears.so' )
19
- python_plugin_path = os .path .join (redisgears_dir , 'plugin/gears_python.so' )
20
23
ret = con .execute_command ('MODULE' , 'LOAD' , redisgears_path , 'Plugin' , python_plugin_path , 'CreateVenv' ,
21
24
0 , 'PythonInstallationDir' , redisgears_dir )
22
25
env .assertEqual (ret , b'OK' )
23
- except Exception as e :
24
- env .debugPrint (str (e ), force = True )
26
+ except Exception :
25
27
env .debugPrint ("skipping since RedisGears not loaded" , force = True )
26
28
return
27
29
return f (env , * args , ** kwargs )
0 commit comments