Commit 7df7231d authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

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: default avatarDonald Hunter <donald.hunter@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b206acf1
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment