- logger.console('Extracting tarball to {0} on {1}'
- .format(con.REMOTE_FW_DIR, node['host']))
- ssh = SSH()
- ssh.connect(node)
- (ret_code, _, _) = ssh.exec_command(
- 'sudo rm -rf {1}; mkdir {1} ; tar -zxf {0} -C {1}; rm -f {0}'
- .format(tarball, con.REMOTE_FW_DIR), timeout=30)
- if ret_code != 0:
- raise RuntimeError('Failed to extract {0} at node {1}'
- .format(tarball, node['host']))
- logger.console('Extracting tarball to {0} on {1} done'
- .format(con.REMOTE_FW_DIR, node['host']))
+ host = node['host']
+ logger.console('Extracting tarball to {0} on {1} starts.'
+ .format(con.REMOTE_FW_DIR, host))
+ exec_cmd_no_error(
+ node, "sudo rm -rf {1}; mkdir {1}; tar -zxf {0} -C {1};"
+ " rm -f {0}".format(tarball, con.REMOTE_FW_DIR),
+ message='Failed to extract {0} at node {1}'.format(tarball, host),
+ timeout=30, include_reason=True)
+ logger.console('Extracting tarball to {0} on {1} done.'
+ .format(con.REMOTE_FW_DIR, host))