From: Ondrej Lichtner <olichtne(a)redhat.com>
For pretty printing the object in automated logs.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/HWAddress.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lnst/Common/HWAddress.py b/lnst/Common/HWAddress.py
index b35550d..0271285 100644
--- a/lnst/Common/HWAddress.py
+++ b/lnst/Common/HWAddress.py
@@ -53,6 +53,9 @@ def _parse_addr(self, addr):
res.append(val)
return res
+ def __repr__(self):
+ return "{}({})".format(self.__class__.__name__, str(self))
+
def hwaddress(addr):
"""Factory method to create a _HWAddress object"""
if isinstance(addr, HWAddress):
--
2.23.0