@@ -15,19 +15,36 @@ def redis_modules_check(local_module_files):
15
15
"Using the following module artifacts: {}" .format (local_module_files )
16
16
)
17
17
for local_module_file in local_module_files :
18
- logging .info (
19
- "Checking if module artifact {} exists..." .format (local_module_file )
20
- )
21
- if os .path .exists (local_module_file ) is False :
22
- error_message = "Specified module artifact does not exist: {}" .format (
23
- local_module_file
24
- )
25
- logging .error (error_message )
26
- status = False
27
- else :
18
+ if type (local_module_file ) is str :
28
19
logging .info (
29
- "Confirmed that module artifact: '{}' exists!" .format (
30
- local_module_file
31
- )
20
+ "Checking if module artifact {} exists..." .format (local_module_file )
21
+ )
22
+ error_message , status = exists_check (
23
+ error_message , local_module_file , status
32
24
)
25
+ if type (local_module_file ) is list :
26
+ for inner_local_module_file in local_module_file :
27
+ logging .info (
28
+ "Checking if module artifact {} exists..." .format (
29
+ inner_local_module_file
30
+ )
31
+ )
32
+ error_message , status = exists_check (
33
+ error_message , inner_local_module_file , status
34
+ )
35
+
33
36
return status , error_message
37
+
38
+
39
+ def exists_check (error_message , local_module_file , status ):
40
+ if os .path .exists (local_module_file ) is False :
41
+ error_message = "Specified module artifact does not exist: {}" .format (
42
+ local_module_file
43
+ )
44
+ logging .error (error_message )
45
+ status = False
46
+ else :
47
+ logging .info (
48
+ "Confirmed that module artifact: '{}' exists!" .format (local_module_file )
49
+ )
50
+ return error_message , status
0 commit comments