mirror of
https://github.com/torvalds/linux
synced 2024-09-06 18:01:05 +00:00
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>
This commit is contained in:
parent
b206acf1ff
commit
7df7231d6a
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue