File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
examples/client/multi-image Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -416,9 +416,10 @@ def scan_container_images(self):
416
416
binary = self .binary
417
417
)
418
418
child ['scan_results' ] = results
419
- except Exception :
420
- import traceback
421
- traceback .print_exc ()
419
+ except Exception as e :
420
+ # import traceback
421
+ # traceback.print_exc()
422
+ self .log ('error' , repr (e ), child )
422
423
logging .error (f"Scanning of { image_name } failed, skipping" )
423
424
424
425
def proceed (self ):
@@ -466,5 +467,22 @@ def main():
466
467
with open (filename_complete , "w" ) as f :
467
468
json .dump (mipm .project_data , f , indent = 2 )
468
469
470
+ failures = list ()
471
+ for sname , sub in mipm .project_data ['subprojects' ].items ():
472
+ structure = False
473
+ runtime = False
474
+ if sub ['status' ] != 'PRESENT' :
475
+ structure = True
476
+ if not sub .get ('scan_results' , None ):
477
+ runtime = True
478
+ else :
479
+ rcodes = [r ['scan_results' ]['returncode' ] for r in sub ['scan_results' ] if r .get ('scan_results' , None )]
480
+ if sum (rcodes ) > 0 :
481
+ runtime = True
482
+ if structure or runtime :
483
+ failures .append (sub )
484
+ with open (filename_failures , "w" ) as f :
485
+ json .dump (failures , f , indent = 2 )
486
+
469
487
if __name__ == "__main__" :
470
488
sys .exit (main ())
You can’t perform that action at this time.
0 commit comments