Build API: Add chroot prefix to Path handling.
Was creating incorrect copied chroot paths due to missing path prefix.
BUG=None
TEST=manual, run_tests
Change-Id: I640b64de05344925f1c679f3471634c1a74dc51d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1648320
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Evan Hernandez <evanhernandez@chromium.org>
Commit-Queue: Alex Klein <saklein@chromium.org>
diff --git a/scripts/build_api.py b/scripts/build_api.py
index 0a7f1fd..4a9bbdb 100644
--- a/scripts/build_api.py
+++ b/scripts/build_api.py
@@ -282,7 +282,7 @@
chroot = field_handler.handle_chroot(input_msg)
base_dir = os.path.join(chroot.path, 'tmp')
- with field_handler.handle_paths(input_msg, base_dir):
+ with field_handler.handle_paths(input_msg, base_dir, prefix=chroot.path):
with osutils.TempDir(base_dir=base_dir) as tempdir:
new_input = os.path.join(tempdir, 'input.json')
chroot_input = '/%s' % os.path.relpath(new_input, chroot.path)