diff options
author | Yaguang Tang <tangyg2@lenovo.com> | 2017-10-20 17:28:32 +0800 |
---|---|---|
committer | Yaguang Tang <tangyg2@lenovo.com> | 2017-10-23 10:03:15 +0800 |
commit | d8c6acc44126bcf0d2f03888ff38f6a966474ae8 (patch) | |
tree | 52f6539fb8c06bd17fe918b7138df03b4f6041a8 /ceilometer/compute | |
parent | 95c81e20d66846c919ffaf2a114d3e3d5e9dc1ae (diff) | |
download | ceilometer-d8c6acc44126bcf0d2f03888ff38f6a966474ae8.tar.gz |
Remove the wrap for skip inspect rbd disk info
Libvirt already support get rbd disk info since 2.0, so we can remove this
wrap waring.
Change-Id: Ie11f64ce5dd9ce60b574ef1f6445d60e60b1887b
Diffstat (limited to 'ceilometer/compute')
-rw-r--r-- | ceilometer/compute/virt/libvirt/inspector.py | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/ceilometer/compute/virt/libvirt/inspector.py b/ceilometer/compute/virt/libvirt/inspector.py index 543d533d..359e0bee 100644 --- a/ceilometer/compute/virt/libvirt/inspector.py +++ b/ceilometer/compute/virt/libvirt/inspector.py @@ -135,27 +135,19 @@ class LibvirtInspector(virt_inspector.Inspector): domain = self._get_domain_not_shut_off_or_raise(instance) tree = etree.fromstring(domain.XMLDesc(0)) for disk in tree.findall('devices/disk'): - disk_type = disk.get('type') - if disk_type: - if disk_type == 'network': - LOG.warning( - 'Inspection disk usage of network disk ' - '%(instance_uuid)s unsupported by libvirt' % { - 'instance_uuid': instance.id}) - continue - # NOTE(lhx): "cdrom" device associated to the configdrive - # no longer has a "source" element. Releated bug: - # https://bugs.launchpad.net/ceilometer/+bug/1622718 - if disk.find('source') is None: - continue - target = disk.find('target') - device = target.get('dev') - if device: - block_info = domain.blockInfo(device) - yield virt_inspector.DiskInfo(device=device, - capacity=block_info[0], - allocation=block_info[1], - physical=block_info[2]) + # NOTE(lhx): "cdrom" device associated to the configdrive + # no longer has a "source" element. Releated bug: + # https://bugs.launchpad.net/ceilometer/+bug/1622718 + if disk.find('source') is None: + continue + target = disk.find('target') + device = target.get('dev') + if device: + block_info = domain.blockInfo(device) + yield virt_inspector.DiskInfo(device=device, + capacity=block_info[0], + allocation=block_info[1], + physical=block_info[2]) @libvirt_utils.raise_nodata_if_unsupported @libvirt_utils.retry_on_disconnect |