Add a patch for ceilometer to fit MOS9.2

In MOS9.2, it added a new function purge_inspection_cache() in
compute pollsters. Each pollsters' get_samples will invoke
self.inspector.purge_inspection_cache() firstly. But xenaip
doesn't define this function, so it will get the following error:
AttributeError: 'XenapiInspector' object has no attribute
'purge_inspection_cache'.
As this function doesn't exist in upstream, let's just apply a
patch to define a empty purge_inspection_cache(). So that it's
able to get samples successfully.

Change-Id: I1177c24651715566850c6fde67f74959b01c7e12
This commit is contained in:
Jianghua Wang 2017-02-28 12:22:40 +08:00
parent e50779856a
commit 3eeb90cedb
2 changed files with 17 additions and 0 deletions

View File

@ -303,11 +303,13 @@ def patch_ceilometer():
ceilometer-poll-cpu-util.patch
ceilometer-rates-always-zero.patch
ceilometer-support-network-bytes.patch
ceilometer-add-purge_inspection_cache.patch
"""
patchfile_list = [
'ceilometer-poll-cpu-util.patch',
'ceilometer-rates-always-zero.patch',
'ceilometer-support-network-bytes.patch',
'ceilometer-add-purge_inspection_cache.patch',
]
for patch_file in patchfile_list:
utils.patch(DIST_PACKAGES_DIR, patch_file, 1)

View File

@ -0,0 +1,15 @@
diff --git a/ceilometer/compute/virt/xenapi/inspector.py b/ceilometer/compute/virt/xenapi/inspector.py
index 6048e3a..d5676b1 100644
--- a/ceilometer/compute/virt/xenapi/inspector.py
+++ b/ceilometer/compute/virt/xenapi/inspector.py
@@ -238,3 +238,10 @@ class XenapiInspector(virt_inspector.Inspector):
write_bytes_rate=write_rate,
write_requests_rate=0)
yield(disk, disk_rate_info)
+
+ def purge_inspection_cache(self):
+ # Empty function to fit MOS9.2 where get_samples will invoke
+ # self.inspector.purge_inspection_cache(); will envalue if
+ # support cache for XenAPI. But obviously we need the
+ # the code for caching available in upstream firstly.
+ pass