diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-02-26 14:49:58 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-03-01 22:13:56 +0000 |
commit | 3bb00af9ab3c7271f32d94f8eb627c94b88fa565 (patch) | |
tree | b465fd0a193125cab0a575c8039c7ce6f5f51788 /scripts | |
parent | 0465558e831df1197c13e476a879f9c5098198a5 (diff) | |
download | poky-3bb00af9ab3c7271f32d94f8eb627c94b88fa565.tar.gz |
devtool: deploy-target: don't specify ssh/scp port unless user does
If the user doesn't specify a port then we should avoid specifying one
on the ssh/scp command line in case the user has configured one for the
host they are connecting to, which was being overridden unnecessarily.
Fixes [YOCTO #12381].
(From OE-Core rev: f1020eef09fada7ef2231d5528576553f3f6bfe1)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/devtool/deploy.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/lib/devtool/deploy.py b/scripts/lib/devtool/deploy.py index 9cc492788b..52e261d560 100644 --- a/scripts/lib/devtool/deploy.py +++ b/scripts/lib/devtool/deploy.py | |||
@@ -213,9 +213,7 @@ def deploy(args, config, basepath, workspace): | |||
213 | 213 | ||
214 | scp_port = '' | 214 | scp_port = '' |
215 | ssh_port = '' | 215 | ssh_port = '' |
216 | if not args.port: | 216 | if args.port: |
217 | raise DevtoolError("If you specify -P/--port then you must provide the port to be used to connect to the target") | ||
218 | else: | ||
219 | scp_port = "-P %s" % args.port | 217 | scp_port = "-P %s" % args.port |
220 | ssh_port = "-p %s" % args.port | 218 | ssh_port = "-p %s" % args.port |
221 | 219 | ||
@@ -280,9 +278,7 @@ def undeploy(args, config, basepath, workspace): | |||
280 | 278 | ||
281 | scp_port = '' | 279 | scp_port = '' |
282 | ssh_port = '' | 280 | ssh_port = '' |
283 | if not args.port: | 281 | if args.port: |
284 | raise DevtoolError("If you specify -P/--port then you must provide the port to be used to connect to the target") | ||
285 | else: | ||
286 | scp_port = "-P %s" % args.port | 282 | scp_port = "-P %s" % args.port |
287 | ssh_port = "-p %s" % args.port | 283 | ssh_port = "-p %s" % args.port |
288 | 284 | ||
@@ -328,7 +324,7 @@ def register_commands(subparsers, context): | |||
328 | parser_deploy.add_argument('-n', '--dry-run', help='List files to be deployed only', action='store_true') | 324 | parser_deploy.add_argument('-n', '--dry-run', help='List files to be deployed only', action='store_true') |
329 | parser_deploy.add_argument('-p', '--no-preserve', help='Do not preserve existing files', action='store_true') | 325 | parser_deploy.add_argument('-p', '--no-preserve', help='Do not preserve existing files', action='store_true') |
330 | parser_deploy.add_argument('--no-check-space', help='Do not check for available space before deploying', action='store_true') | 326 | parser_deploy.add_argument('--no-check-space', help='Do not check for available space before deploying', action='store_true') |
331 | parser_deploy.add_argument('-P', '--port', default='22', help='Port to use for connection to the target') | 327 | parser_deploy.add_argument('-P', '--port', help='Specify port to use for connection to the target') |
332 | 328 | ||
333 | strip_opts = parser_deploy.add_mutually_exclusive_group(required=False) | 329 | strip_opts = parser_deploy.add_mutually_exclusive_group(required=False) |
334 | strip_opts.add_argument('-S', '--strip', | 330 | strip_opts.add_argument('-S', '--strip', |
@@ -350,5 +346,5 @@ def register_commands(subparsers, context): | |||
350 | parser_undeploy.add_argument('-s', '--show-status', help='Show progress/status output', action='store_true') | 346 | parser_undeploy.add_argument('-s', '--show-status', help='Show progress/status output', action='store_true') |
351 | parser_undeploy.add_argument('-a', '--all', help='Undeploy all recipes deployed on the target', action='store_true') | 347 | parser_undeploy.add_argument('-a', '--all', help='Undeploy all recipes deployed on the target', action='store_true') |
352 | parser_undeploy.add_argument('-n', '--dry-run', help='List files to be undeployed only', action='store_true') | 348 | parser_undeploy.add_argument('-n', '--dry-run', help='List files to be undeployed only', action='store_true') |
353 | parser_undeploy.add_argument('-P', '--port', default='22', help='Port to use for connection to the target') | 349 | parser_undeploy.add_argument('-P', '--port', help='Specify port to use for connection to the target') |
354 | parser_undeploy.set_defaults(func=undeploy) | 350 | parser_undeploy.set_defaults(func=undeploy) |