ssh: Improve error when failing to push file
CalledProcessError doesn't include the output of the failed command
in the message it prints, so use a HostError isntead.
diff --git a/devlib/utils/ssh.py b/devlib/utils/ssh.py
index 5470367..aaab2dd 100644
--- a/devlib/utils/ssh.py
+++ b/devlib/utils/ssh.py
@@ -292,7 +292,8 @@
try:
check_output(command, timeout=timeout, shell=True)
except subprocess.CalledProcessError as e:
- raise subprocess.CalledProcessError(e.returncode, command_redacted e.output)
+ raise HostError("Failed to copy file with '{}'. Output:\n{}".format(
+ command_redacted, e.output))
except TimeoutError as e:
raise TimeoutError(command_redacted, e.output)