From 3d7777f0613ef45bce39c8448ed6664e9280ff0d Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Sun, 8 Mar 2015 13:03:33 +0000 Subject: devtool: deploy-target: add an option to disable quiet mode The -q option to scp does stop the progress being shown, which is mostly superfluous, however it also stops errors from ssh being shown - if there's a problem, you'll just get "lost connection" which really isn't that helpful. As a compromise, add a -s/--show-status option and advertise this when the command fails. (From OE-Core rev: 5cbb026212b4c8f5206a07d70b94f57edeee0839) Signed-off-by: Paul Eggleton Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- scripts/lib/devtool/deploy.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/lib/devtool/deploy.py b/scripts/lib/devtool/deploy.py index 68edb98..c152ac0 100644 --- a/scripts/lib/devtool/deploy.py +++ b/scripts/lib/devtool/deploy.py @@ -57,8 +57,11 @@ def deploy(args, config, basepath, workspace): extraoptions = '' if args.no_host_check: extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' - ret = subprocess.call('scp -qr %s %s/* %s:%s' % (extraoptions, recipe_outdir, args.target, destdir), shell=True) + if not args.show_status: + extraoptions += ' -q' + ret = subprocess.call('scp -r %s %s/* %s:%s' % (extraoptions, recipe_outdir, args.target, destdir), shell=True) if ret != 0: + logger.error('Deploy failed - rerun with -s to get a complete error message') return ret logger.info('Successfully deployed %s' % recipe_outdir) @@ -87,16 +90,20 @@ def undeploy(args, config, basepath, workspace): extraoptions = '' if args.no_host_check: extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' + if not args.show_status: + extraoptions += ' -q' - ret = subprocess.call("scp -q %s %s %s:/tmp" % (extraoptions, deploy_file, args.target), shell=True) + ret = subprocess.call("scp %s %s %s:/tmp" % (extraoptions, deploy_file, args.target), shell=True) if ret != 0: - logger.error('Failed to copy %s to %s' % (deploy, args.target)) + logger.error('Failed to copy file list to %s - rerun with -s to get a complete error message' % args.target) return -1 ret = subprocess.call("ssh %s %s 'xargs -n1 rm -f