From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 232082904 for ; Wed, 28 Jun 2017 17:53:06 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 28 Jun 2017 08:53:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,276,1496127600"; d="scan'208";a="102351170" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 28 Jun 2017 08:53:05 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Jun 2017 08:53:05 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.51]) by fmsmsx122.amr.corp.intel.com ([169.254.5.34]) with mapi id 14.03.0319.002; Wed, 28 Jun 2017 08:53:05 -0700 From: "Wiles, Keith" To: "McCullough, Harrison" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] bug: Use correct arguments in run.py Thread-Index: AdLwHeHb+kgTUFpAQAafm1Az8KRQggAQ2sMA Date: Wed, 28 Jun 2017 15:53:05 +0000 Message-ID: References: <942AD08E4186F644A54168E4F84117C9317C60@SAUSMAILMBX1.ad.tri.sbc.com> In-Reply-To: <942AD08E4186F644A54168E4F84117C9317C60@SAUSMAILMBX1.ad.tri.sbc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.241.224.138] Content-Type: text/plain; charset="us-ascii" Content-ID: <5A770FF1F4A1DD4184C981E2695A41B4@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] bug: Use correct arguments in run.py X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 15:53:07 -0000 > On Jun 28, 2017, at 7:54 AM, McCullough, Harrison wrote: >=20 > When using run.py it would occasionally ignore the given command line > arguments because the wrong variable was used. Fixed this, along with > minor changes to reflect more idiomatic Python usage. Thanks I will integrate these changes into the next version of Pktgen. >=20 > Signed-off-by: Harrison McCullough > --- > tools/run.py | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) >=20 > diff --git a/tools/run.py b/tools/run.py > index ec6f45d..f5ec22c 100755 > --- a/tools/run.py > +++ b/tools/run.py > @@ -96,7 +96,7 @@ def find_file(arg, t): > for f in file_list('.', t): > if os.path.basename(f) =3D=3D fn: > return f > - return ""=20 > + return None >=20 > def parse_args(): > ''' Parse the command arguments ''' > @@ -118,7 +118,7 @@ def parse_args(): > print("Run '%s --usage' for further information" % sys.argv[0]) > sys.exit(1) >=20 > - for opt, arg in opts: > + for opt, _ in opts: > if opt =3D=3D "--help" or opt =3D=3D "-h" or opt =3D=3D "--usage"= or opt =3D=3D "-u": > usage() > sys.exit(0) > @@ -128,13 +128,12 @@ def parse_args(): > if opt =3D=3D "--setup" or opt =3D=3D "-s": > run_flag =3D False >=20 > - arg =3D sys.argv[1:] > - if arg =3D=3D "": > + if not args or len(args) > 1: > usage() > sys.exit(1) >=20 > - fn =3D find_file(arg[0], cfg_ext) > - if fn !=3D "": > + fn =3D find_file(args[0], cfg_ext) > + if fn: > cfg_file =3D fn >=20 > def load_cfg(): > --=20 > 1.9.1 >=20 Regards, Keith