Comment 10 for bug 1594230

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/346868
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=72fb6726c07707d6b7ec6052f97e24f44b2c45ab
Submitter: Jenkins
Branch: master

commit 72fb6726c07707d6b7ec6052f97e24f44b2c45ab
Author: Hironori Shiina <email address hidden>
Date: Mon Jul 25 23:29:55 2016 +0900

    Allow empty CPU info of hypervisors in API response

    CPU info of hypervisors in an API response was changed from string to
    object at API microversion 2.28. CPU info in a hypervisor object can be
    empty when using some virt drivers such as ironic virt driver. If the
    CPU info is an empty string or None, it cannot be convert to a JSON
    object with json.loads method. It causes an internal server error.

    This patch sets CPU info in an API response to an empty dict without
    using json.loads method in this case follwing the schema of the
    response data.

    This patch also adds unit tests for this fix. These tests copies a
    hypervisor object locally and modified the copy. In
    CellHypervisorsTestV21, hypervisor objects are wrapped by
    ComputeNodeProxy. In order to apply deepcopy to a ComputeNodeProxy,
    the test adds __deepcopy__ method to the class. Without __deepcopy__,
    __deepcopy__ of an self._obj works due to __getattr__
    method of the proxy, which creates a copy of self._obj.

    Change-Id: I34a7937ee6df985587fa98ccc3a17c969516d5ef
    Closes-Bug: #1594230