Enable identifying variants in exception traces

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-01-12 14:09:47 +01:00
parent 5f0675dd66
commit 6e0f6ee73e

View File

@ -185,6 +185,9 @@ class Variant(object):
def __str__(self): def __str__(self):
return self.uid 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): def __cmp__(self, other):
# variant < addon, layered-product < optional # variant < addon, layered-product < optional
if self.type == other.type: if self.type == other.type: