[dpdk-stable] patch 'usertools: fix telemetry client with python 3' has been queued to LTS release 18.11.6
Kevin Traynor
ktraynor at redhat.com
Tue Dec 10 15:59:20 CET 2019
Hi,
FYI, your patch has been queued to LTS release 18.11.6
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/16/19. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/66742b2c696789ef642042d035284bf1fc4f3a26
Thanks.
Kevin.
---
>From 66742b2c696789ef642042d035284bf1fc4f3a26 Mon Sep 17 00:00:00 2001
From: Robin Jarry <robin.jarry at 6wind.com>
Date: Thu, 17 Oct 2019 19:32:12 +0200
Subject: [PATCH] usertools: fix telemetry client with python 3
[ upstream commit fe35622659edc678992aea389beb152105051e7f ]
When running the dpdk-telemetry-client.py with python 3, we get the
following syntax errors:
File "usertools/dpdk-telemetry-client.py", line 70
print "\nResponse: \n", str(data)
^
SyntaxError: invalid syntax
File "usertools/dpdk-telemetry-client.py", line 93
print "\nResponse: \n", str(data)
^
SyntaxError: invalid syntax
File "usertools/dpdk-telemetry-client.py", line 111
file_path = sys.argv[1]
^
TabError: inconsistent use of tabs and spaces in indentation
Import print_function from __future__ and add parentheses where missing.
Also, use spaces for indentation everywhere.
Fixes: d1b94da4a4e0 ("usertools: add client script for telemetry")
Fixes: 53f293c9a783 ("usertools: replace unsafe input function")
Fixes: 4080e46c8078 ("telemetry: support global metrics")
Signed-off-by: Robin Jarry <robin.jarry at 6wind.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
usertools/dpdk-telemetry-client.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/usertools/dpdk-telemetry-client.py b/usertools/dpdk-telemetry-client.py
index e0587022c..1c61a2a28 100644
--- a/usertools/dpdk-telemetry-client.py
+++ b/usertools/dpdk-telemetry-client.py
@@ -2,4 +2,6 @@
# Copyright(c) 2018 Intel Corporation
+from __future__ import print_function
+
import socket
import os
@@ -15,7 +17,7 @@ DEFAULT_FP = "/var/run/dpdk/default_client"
try:
- raw_input # Python 2
+ raw_input # Python 2
except NameError:
- raw_input = input # Python 3
+ raw_input = input # Python 3
class Socket:
@@ -73,5 +75,5 @@ class Client:
self.socket.client_fd.send(METRICS_REQ)
data = self.socket.client_fd.recv(BUFFER_SIZE)
- print "\nResponse: \n", str(data)
+ print("\nResponse: \n", str(data))
def repeatedlyRequestMetrics(self, sleep_time): # Recursively requests metrics for given client
@@ -112,8 +114,8 @@ if __name__ == "__main__":
file_path = ""
if (len(sys.argv) == 2):
- file_path = sys.argv[1]
+ file_path = sys.argv[1]
else:
print("Warning - No filepath passed, using default (" + DEFAULT_FP + ").")
- file_path = DEFAULT_FP
+ file_path = DEFAULT_FP
client = Client()
client.getFilepath(file_path)
--
2.21.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2019-12-10 14:49:42.153148203 +0000
+++ 0046-usertools-fix-telemetry-client-with-python-3.patch 2019-12-10 14:49:39.077457301 +0000
@@ -1 +1 @@
-From fe35622659edc678992aea389beb152105051e7f Mon Sep 17 00:00:00 2001
+From 66742b2c696789ef642042d035284bf1fc4f3a26 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fe35622659edc678992aea389beb152105051e7f ]
+
@@ -30 +31,0 @@
-Cc: stable at dpdk.org
@@ -35,2 +36,2 @@
- usertools/dpdk-telemetry-client.py | 14 ++++++++------
- 1 file changed, 8 insertions(+), 6 deletions(-)
+ usertools/dpdk-telemetry-client.py | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
@@ -39 +40 @@
-index 60fe97af7..e06d6306c 100755
+index e0587022c..1c61a2a28 100644
@@ -42 +43 @@
-@@ -3,4 +3,6 @@
+@@ -2,4 +2,6 @@
@@ -49 +50 @@
-@@ -17,7 +19,7 @@ DEFAULT_FP = "/var/run/dpdk/default_client"
+@@ -15,7 +17,7 @@ DEFAULT_FP = "/var/run/dpdk/default_client"
@@ -59 +60 @@
-@@ -75,5 +77,5 @@ class Client:
+@@ -73,5 +75,5 @@ class Client:
@@ -66,8 +67 @@
-@@ -89,5 +91,5 @@ class Client:
- self.socket.client_fd.send(GLOBAL_METRICS_REQ)
- data = self.socket.client_fd.recv(BUFFER_SIZE)
-- print "\nResponse: \n", str(data)
-+ print("\nResponse: \n", str(data))
-
- def interactiveMenu(self, sleep_time): # Creates Interactive menu within the script
-@@ -122,8 +124,8 @@ if __name__ == "__main__":
+@@ -112,8 +114,8 @@ if __name__ == "__main__":
More information about the stable
mailing list