Add Volume.__str__()

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-05-28 18:06:12 +02:00
parent 3dd77719c1
commit 8fc3772017
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -99,6 +99,9 @@ class Volume(object):
def __hash__(self): def __hash__(self):
return hash('%s:%s %s' % (self.pool, self.vid, self.volume_type)) return hash('%s:%s %s' % (self.pool, self.vid, self.volume_type))
def __str__(self):
return "{!s}:{!s}".format(self.pool, self.vid)
class Storage(object): class Storage(object):
''' Class for handling VM virtual disks. ''' Class for handling VM virtual disks.