Replace Volume.__str__ with enhanced __repr__

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-04-22 14:47:00 +02:00
parent 04536c5950
commit 591134833b

View File

@ -81,8 +81,10 @@ class Volume(object):
'pool': self.pool,
'volume_type': self.volume_type}
def __str__(self):
return str({'name': self.name, 'pool': self.pool, 'vid': self.vid})
def __repr__(self):
return '{}(name={!s}, pool={!r}, vid={!r}, volume_type={!r})'.format(
self.__class__.__name__, self.name, self.pool, self.vid,
self.volume_type)
def block_device(self):
''' Return :py:class:`qubes.devices.BlockDevice` for serialization in