File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -265,8 +265,20 @@ def stream(self) -> Optional[str]:
265
265
266
266
@property
267
267
def group (self ) -> Optional [str ]:
268
- """The log group for the job, if available."""
269
- options = self .describe_job ()["container" ]["logConfiguration" ]["options" ] # type: ignore
268
+ """The log group for the job, if available.
269
+
270
+ If the stream is not available, then None is returned. Otherwise, looks in
271
+ container.logConfiguration.options.awslogs-group, returning "/aws/batch/job" if that path
272
+ is not found.
273
+ """
274
+ if self .stream is None :
275
+ return None
276
+ config = self .describe_job ()["container" ].get ("logConfiguration" ) # type: ignore
277
+ if config is None :
278
+ return "/aws/batch/job"
279
+ options = config .get ("options" ) # type: ignore
280
+ if options is None :
281
+ return "/aws/batch/job"
270
282
return options .get ("awslogs-group" ) # type: ignore
271
283
272
284
def submit (self ) -> SubmitJobResponseTypeDef :
You can’t perform that action at this time.
0 commit comments