api/controller: Specify packages as argument

BUG=none
TEST=./run_tests

Change-Id: I26a0484ddbe852745e0b3e049c6c9cc9281751c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3566169
Reviewed-by: Sloan Johnson <sloanjohnson@google.com>
Commit-Queue: Lizzy Presland <zland@google.com>
Auto-Submit: Lizzy Presland <zland@google.com>
Tested-by: Lizzy Presland <zland@google.com>
diff --git a/api/controller/controller_util.py b/api/controller/controller_util.py
index db8a85d..d105444 100644
--- a/api/controller/controller_util.py
+++ b/api/controller/controller_util.py
@@ -7,7 +7,7 @@
 import glob
 import logging
 import os
-from typing import Optional, TYPE_CHECKING, Union
+from typing import Iterable, Optional, TYPE_CHECKING, Union
 
 from chromite.api.gen.chromite.api import sysroot_pb2
 from chromite.api.gen.chromite.api import test_pb2
@@ -195,7 +195,7 @@
   return package_info.parse(PackageInfoToString(pkg_info_msg))
 
 
-def retrieve_package_log_paths(error: sysroot_lib.PackageInstallError,
+def retrieve_package_log_paths(packages: Iterable[package_info.PackageInfo],
                                output_proto: Union[
                                    sysroot_pb2.InstallPackagesResponse,
                                    sysroot_pb2.InstallToolchainResponse,
@@ -205,12 +205,12 @@
   """Get the path to the log file for each package that failed to build.
 
   Args:
-    error: The error message produced by the build step.
+    packages: A list of packages which failed to build.
     output_proto: The Response message for a given API call. This response proto
       must contain a failed_package_data field.
     target_sysroot: The sysroot used by the build step.
   """
-  for pkg_info in error.failed_packages:
+  for pkg_info in packages:
     # Grab the paths to the log files for each failed package from the
     # sysroot.
     # Logs currently exist within the sysroot in the form of: