From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4A119A00E6 for ; Thu, 8 Aug 2019 16:46:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A02C1BE6C; Thu, 8 Aug 2019 16:46:34 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E43A41BE5E; Thu, 8 Aug 2019 16:46:29 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2019 07:38:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,361,1559545200"; d="scan'208";a="177332233" Received: from silpixa00393949.ir.intel.com (HELO silpixa00393949.ger.corp.intel.com) ([10.237.222.145]) by orsmga003.jf.intel.com with ESMTP; 08 Aug 2019 07:38:06 -0700 From: Andrius Sirvys To: Kevin Laatz Cc: dev@dpdk.org, stable@dpdk.org, harry.van.haaren@intel.com, cian.ferriter@intel.com, herakliusz.lipiec@intel.com, Andrius Sirvys Date: Thu, 8 Aug 2019 15:37:52 +0100 Message-Id: <20190808143753.16788-1-andrius.sirvys@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190807130458.16754-1-andrius.sirvys@intel.com> References: <20190807130458.16754-1-andrius.sirvys@intel.com> Subject: [dpdk-stable] [PATCH v3] usertools: fix input handling in telemetry script X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" This commit removes the unnecesarry ast.literal_eval() function call from the input handling, which now relies just on raw_input() to get its input. Fixes: 53f293c9a783 ("usertools: replace unsafe input function") Cc: andrius.sirvys@intel.com Signed-off-by: Andrius Sirvys --- v2: Removed unnecessary comments v3: Reduced scope of changes only to required Python 2 fix Please note that the dpdk-telemetry-client.py script has a number of issues with Python3 support. Fixing Python3 support is being deferred to DPDK 19.11 release. --- usertools/dpdk-telemetry-client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usertools/dpdk-telemetry-client.py b/usertools/dpdk-telemetry-client.py index 4b0502ff9..60fe97af7 100755 --- a/usertools/dpdk-telemetry-client.py +++ b/usertools/dpdk-telemetry-client.py @@ -78,7 +78,7 @@ def requestMetrics(self): # Requests metrics for given client def repeatedlyRequestMetrics(self, sleep_time): # Recursively requests metrics for given client print("\nPlease enter the number of times you'd like to continuously request Metrics:") - n_requests = int(ast.literal_eval(raw_input("\n:"))) + n_requests = int(raw_input("\n:")) print("\033[F") #Removes the user input from screen, cleans it up print("\033[K") for i in range(n_requests): @@ -99,7 +99,7 @@ def interactiveMenu(self, sleep_time): # Creates Interactive menu within the scr print("[4] Unregister client") try: - self.choice = int(ast.literal_eval(raw_input("\n:"))) + self.choice = int(raw_input("\n:")) print("\033[F") #Removes the user input for screen, cleans it up print("\033[K") if self.choice == 1: -- 2.17.1