From 2a3d5e2579a952eb46d9f7dee0fce636f860a562 Mon Sep 17 00:00:00 2001 From: Zhixiong Chi Date: Wed, 10 Nov 2021 17:31:51 +0800 Subject: [PATCH] stx tool: Update the check for the build image task The args.type will be list type when we use the original method, it will cause the issue the checking doesn't work. Now we correct it. Story: 2008862 Task: 43928 Signed-off-by: Zhixiong Chi Change-Id: I776ca1372ec6470a075da54ab421a02028e3615a --- stx/lib/stx/stx_build.py | 2 +- stx/lib/stx/stx_main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stx/lib/stx/stx_build.py b/stx/lib/stx/stx_build.py index 345ac410..05d2a5b3 100644 --- a/stx/lib/stx/stx_build.py +++ b/stx/lib/stx/stx_build.py @@ -32,7 +32,7 @@ class HandleBuildTask: def buildImageCMD(self, args, prefixcmd): if args.type: - if (args.type != 'rt' and args.type != 'std'): + if args.type not in ['rt', 'std']: self.logger.error('Option -t for generaing image only should \ be [ rt|std ]') self.logger.error('Please use "stx build -h" to show the help\ diff --git a/stx/lib/stx/stx_main.py b/stx/lib/stx/stx_main.py index a172a1f2..4cc146c3 100644 --- a/stx/lib/stx/stx_main.py +++ b/stx/lib/stx/stx_main.py @@ -105,7 +105,7 @@ image.\t\teg: [ prepare|distro|image|${pkgname}]') ', action='store_true', required=False) build_subparser.add_argument('-t', '--type', help='[ rt|std ]: Select the kernel type.\ - ', nargs=1, required=False) + ', required=False) build_subparser.set_defaults(handle=self.handlebuild.handleBuild) repo_subparser = subparsers.add_parser('repomgr',