Skip to content

Commit 855a6e9

Browse files
author
Murat Kumykov
committed
added --serialize option for multi-image script
1 parent bb4d992 commit 855a6e9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/client/multi-image/manage_project_structure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def __init__(self, args):
8383
self.load_project_data()
8484
else:
8585
self.init_project_data(args)
86+
self.serialize = args.serialize
8687

8788
def connect(self):
8889
self.client = Client(base_url=self.base_url, token=self.access_token, verify=self.no_verify, timeout=60.0, retries=4)
@@ -438,6 +439,8 @@ def scan_container_images(self):
438439
detect_options = (f"--detect.parent.project.name={parent_project} "
439440
f"--detect.parent.project.version.name={parent_version} "
440441
f"--detect.project.version.nickname={image_name}")
442+
if self.serialize:
443+
detect_options += f" --detect.wait.for.results=true"
441444
if self.individual_file_matching:
442445
detect_options += f" --detect.blackduck.signature.scanner.individual.file.matching=ALL"
443446
if clone_from:
@@ -531,6 +534,7 @@ def parse_command_args():
531534
parser.add_argument("--binary", action='store_true', help="Use binary scan for analysis")
532535
parser.add_argument("-ifm", "--individual-file-matching", action='store_true', help="Turn Individual file matching on")
533536
parser.add_argument("--reprocess-run-file", help="Reprocess Failures from previous run report.")
537+
parser.add_argument("--serialize", action='store_true', help="Serialize scan submissions by adding --detect.wait.for.results=true to scan invocations")
534538
args = parser.parse_args()
535539
if not args.reprocess_run_file and not (args.project_name and args.version_name):
536540
parser.error("[ -p/--project-name and -pv/--version-name ] or --reprocess-run-file are required")

0 commit comments

Comments
 (0)