summaryrefslogtreecommitdiffstats
path: root/tools/net/ynl/lib
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-03-04 21:33:07 -0800
committerDavid S. Miller <davem@davemloft.net>2024-03-06 12:07:43 +0000
commit7df7231d6a6b68b4b68fb4e38a4639997a208fd2 (patch)
treeac0f0f097cb5a78b89a7bef8f51c52799c5347e7 /tools/net/ynl/lib
parentb206acf1ffdc505844e6f7dc26848db068e45221 (diff)
downloadlinux-stable-7df7231d6a6b68b4b68fb4e38a4639997a208fd2.tar.gz
linux-stable-7df7231d6a6b68b4b68fb4e38a4639997a208fd2.tar.bz2
linux-stable-7df7231d6a6b68b4b68fb4e38a4639997a208fd2.zip
tools: ynl: move the new line in NlMsg __repr__
We add the new line even if message has no error or extack, which leads to print(nl_msg) ending with two new lines. Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/net/ynl/lib')
-rw-r--r--tools/net/ynl/lib/ynl.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
index ac55aa5a3083..92ade9105f31 100644
--- a/tools/net/ynl/lib/ynl.py
+++ b/tools/net/ynl/lib/ynl.py
@@ -213,11 +213,11 @@ class NlMsg:
return self.nl_type
def __repr__(self):
- msg = f"nl_len = {self.nl_len} ({len(self.raw)}) nl_flags = 0x{self.nl_flags:x} nl_type = {self.nl_type}\n"
+ msg = f"nl_len = {self.nl_len} ({len(self.raw)}) nl_flags = 0x{self.nl_flags:x} nl_type = {self.nl_type}"
if self.error:
- msg += '\terror: ' + str(self.error)
+ msg += '\n\terror: ' + str(self.error)
if self.extack:
- msg += '\textack: ' + repr(self.extack)
+ msg += '\n\textack: ' + repr(self.extack)
return msg