From 591134833b67fbf7e50d4c809f7ff7b5b41ae93a Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Fri, 22 Apr 2016 14:47:00 +0200 Subject: [PATCH] Replace Volume.__str__ with enhanced __repr__ --- qubes/storage/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qubes/storage/__init__.py b/qubes/storage/__init__.py index 56c9fbcd..98aeddcf 100644 --- a/qubes/storage/__init__.py +++ b/qubes/storage/__init__.py @@ -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