[virt-tools-list] [virt-manager PATCH] virt-manager, delete: fix path for disk type='volume'
Giuseppe Scrivano
gscrivan at redhat.com
Fri Oct 10 07:49:08 UTC 2014
Cole Robinson <crobinso at redhat.com> writes:
> On 10/09/2014 05:17 AM, Giuseppe Scrivano wrote:
>> Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1146869
>>
>> Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
>> ---
>> virtManager/delete.py | 13 +++++++++++--
>> 1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/virtManager/delete.py b/virtManager/delete.py
>> index 248392f..b865d18 100644
>> --- a/virtManager/delete.py
>> +++ b/virtManager/delete.py
>> @@ -232,8 +232,17 @@ def populate_storage_list(storage_list, vm, conn):
>> model = storage_list.get_model()
>> model.clear()
>>
>> - diskdata = [(disk.target, disk.path, disk.read_only, disk.shareable) for
>> - disk in vm.get_disk_devices()]
>> + def get_path(disk):
>> + if disk.sourcePool:
>> + pool = conn.get_pool(disk.sourcePool)
>> + if pool:
>> + vol = pool.get_volume(disk.path)
>
> get_pool and get_volume should never return None, only throw a KeyError when
> the pool doesn't exist. So drop the if: checks, and wrap the whole thing in
> try: except: KeyError, and if that fails just return path = None I think
the same problem is present in details.py, I'll send another patch to
fix this too.
Thanks,
Giuseppe
More information about the virt-tools-list
mailing list