qvm-block use new storage API

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-07-03 18:21:48 +02:00
parent 95fed1eb71
commit e07c4cc8e8
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -45,19 +45,20 @@ def prepare_table(vd_list, full=False):
''' '''
output = [] output = []
if sys.stdout.isatty(): if sys.stdout.isatty():
output += [('POOL_NAME:VOLUME_ID', 'VOLUME_TYPE', 'VMNAME')] output += [('POOL:VOLUME', 'VMNAME', 'VOLUME_NAME')] # NOQA
for volume in vd_list: for volume in vd_list:
if volume.domains: if volume.domains:
vmname = volume.domains.pop() vmname, volume_name = volume.domains.pop()
output += [(str(volume), volume.volume_type, vmname)] output += [(str(volume), vmname, volume_name)]
for vmname in volume.domains: for tupple in volume.domains:
vmname, volume_name = tupple
if full or not sys.stdout.isatty(): if full or not sys.stdout.isatty():
output += [(str(volume), volume.volume_type, vmname)] output += [(str(volume), vmname, volume_name)]
else: else:
output += [('', '', vmname)] output += [('', vmname, volume_name)]
else: else:
output += [(str(volume), volume.volume_type)] output += [(str(volume), "")]
return output return output
@ -70,7 +71,6 @@ class VolumeData(object):
def __init__(self, volume): def __init__(self, volume):
self.name = volume.name self.name = volume.name
self.pool = volume.pool self.pool = volume.pool
self.volume_type = volume.volume_type
self.vid = volume.vid self.vid = volume.vid
self.domains = [] self.domains = []