api: Fix branch reexecs with no config.
SDK reexecs parse and rewrite the input and config, so when no
config is passed, an empty one gets written out for the reexec.
This is skipped in the current branched reexecs to avoid proto
version problems, so instead check for no config and skip passing
it in the reexec.
BUG=None
TEST=run_tests
Change-Id: Ie91fe9aecd9146d467d8d087292967855a013140
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4523114
Auto-Submit: Alex Klein <saklein@chromium.org>
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Benjamin Shai <bshai@google.com>
Commit-Queue: Benjamin Shai <bshai@google.com>
Commit-Queue: Alex Klein <saklein@chromium.org>
diff --git a/api/router.py b/api/router.py
index bd80d80..d56abcc 100644
--- a/api/router.py
+++ b/api/router.py
@@ -408,16 +408,22 @@
f"{service_name}/{method_name}",
input_handler.input_arg,
input_handler.path,
- config_handler.config_arg,
- config_handler.path,
"--debug",
]
+
for output_handler in output_handlers:
cmd += [
output_handler.output_arg,
output_handler.path,
]
+ # Config is optional, check it was actually used before adding.
+ if config_handler.path:
+ cmd += [
+ config_handler.config_arg,
+ config_handler.path,
+ ]
+
try:
result = cros_build_lib.run(
cmd,