@@ -12,16 +12,18 @@ def wrapper(env, *args, **kwargs):
1212 modules = con .execute_command ("MODULE" , "LIST" )
1313 if b'rg' in [module [1 ] for module in modules ]:
1414 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' )
1522 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' )
2023 ret = con .execute_command ('MODULE' , 'LOAD' , redisgears_path , 'Plugin' , python_plugin_path , 'CreateVenv' ,
2124 0 , 'PythonInstallationDir' , redisgears_dir )
2225 env .assertEqual (ret , b'OK' )
23- except Exception as e :
24- env .debugPrint (str (e ), force = True )
26+ except Exception :
2527 env .debugPrint ("skipping since RedisGears not loaded" , force = True )
2628 return
2729 return f (env , * args , ** kwargs )
0 commit comments