File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -41,13 +41,17 @@ def run(self, results):
41
41
return
42
42
43
43
# Read configuration options from gcs.conf
44
+ # Read configuration options from gcs.conf and validate them
44
45
bucket_name = self .options .get ("bucket_name" )
45
- credentials_path = self .options .get ("credentials_path" , "" )
46
- credentials_path = os .path .join (CUCKOO_ROOT , credentials_path )
47
- # Validate configuration
48
46
if not bucket_name :
49
47
raise CuckooReportError ("GCS bucket_name is not configured in reporting.conf -> gcs" )
50
- if not credentials_path or not os .path .exists ():
48
+
49
+ credentials_path_str = self .options .get ("credentials_path" )
50
+ if not credentials_path_str :
51
+ raise CuckooReportError ("GCS credentials_path is not configured in reporting.conf -> gcs" )
52
+
53
+ credentials_path = os .path .join (CUCKOO_ROOT , credentials_path_str )
54
+ if not os .path .isfile (credentials_path ):
51
55
raise CuckooReportError (
52
56
f"GCS credentials_path '{ credentials_path } ' is invalid or file does not exist in reporting.conf -> gcs"
53
57
)
You can’t perform that action at this time.
0 commit comments