From 6e0f6ee73e474527c993d3eb65e771af0806cf2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 12 Jan 2016 14:09:47 +0100 Subject: [PATCH] Enable identifying variants in exception traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When pungi crashes, the logs will often contain useless description of a variant. With this patch, the traceback will have details on the variant. Signed-off-by: Lubomír Sedlář --- pungi/wrappers/variants.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pungi/wrappers/variants.py b/pungi/wrappers/variants.py index 14e66647..6625642e 100755 --- a/pungi/wrappers/variants.py +++ b/pungi/wrappers/variants.py @@ -185,6 +185,9 @@ class Variant(object): def __str__(self): return self.uid + def __repr__(self): + return 'Variant(id="{0.id}", name="{0.name}", type="{0.type}", parent={0.parent})'.format(self) + def __cmp__(self, other): # variant < addon, layered-product < optional if self.type == other.type: