Fix bug with not implemented virConnect.registerCloseCallback
The unit test test_connection_to_primitive fails many times due to
"virConnect instance has no attribute 'registerCloseCallback'".
registerCloseCallback has been added since original(community's)
python-libvirt v1.0.0, and v1.2.0 also contains the method.
However ubuntu cloud's v1.0.1 does not contain the method, and current
version check of python-libvirt does not work.
This patch tries to operate the method and catch TypeError exception if
the method does not exist instead of the version check.
Reviewed: https:/ /review. openstack. org/112422 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=6484fc6f0f4 c8a671928045921 50ef0185f6a7cc
Committed: https:/
Submitter: Jenkins
Branch: stable/havana
commit 6484fc6f0f4c8a6 7192804592150ef 0185f6a7cc
Author: Ken'ichi Ohmichi <email address hidden>
Date: Wed Jan 8 06:43:42 2014 +0900
Fix bug with not implemented virConnect. registerCloseCa llback
The unit test test_connection _to_primitive fails many times due to allback' ".
"virConnect instance has no attribute 'registerCloseC
registerClo seCallback has been added since original( community' s)
python-libvirt v1.0.0, and v1.2.0 also contains the method.
However ubuntu cloud's v1.0.1 does not contain the method, and current
version check of python-libvirt does not work.
This patch tries to operate the method and catch TypeError exception if
the method does not exist instead of the version check.
Conflicts:
nova/ tests/virt/ libvirt/ test_libvirt. py
NOTE(mriedem): The conflict is due to set_host_enabled
calls which aren't in stable/havana.
Co-Authored-By: Sahid Orentino Ferdjaoui <email address hidden> ae5b146f400c901 15c83afcda7 4895ffe5ac185bb 9cf7d05e2d)
Closes-Bug: #1266711
Change-Id: I4ec9ff9a684639
(cherry picked from commit 85068cc9f68aa70