cros_bundle_firmware: Allow operation without servo
While servo is useful for automation, we should respect a request to not
use it. For em100 and Tegra it isn't really needed. Even for exynos is
can be avoided if the user pressed buttons at the right time.
BUG=none
TEST=FEATURES=test sudo -E emerge cros-devutils
Change-Id: I78b7151b9117556cd7ce306dab354164f8126e13
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43002
diff --git a/host/lib/write_firmware.py b/host/lib/write_firmware.py
index 32a59cc..4df891e 100644
--- a/host/lib/write_firmware.py
+++ b/host/lib/write_firmware.py
@@ -360,19 +360,18 @@
def DutControl(self, args):
"""Run dut-control with supplied arguments.
- The correct servo will be used based on self._servo_port.
+ The correct servo will be used based on self._servo_port. If servo use is
+ disabled, this function does nothing.
Args:
args: List of arguments to dut-control.
- Retruns:
+ Returns:
a string, stdout generated by running the command
- Raises:
- IOError if no servo access is permitted.
"""
if self._servo_port is None:
- raise IOError('No servo access available, please use --servo')
- if self._servo_port:
+ return '' # User has requested not to use servo
+ elif self._servo_port:
args.extend(['-p', '%s' % self._servo_port])
return self._tools.Run('dut-control', args)