Comment 4 for bug 1499271

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

Reviewed: https://review.openstack.org/227744
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=51d74bdf18df39695ad5e500db6db830f21da36a
Submitter: Jenkins
Branch: stable/liberty

commit 51d74bdf18df39695ad5e500db6db830f21da36a
Author: Yingxin Cheng <email address hidden>
Date: Wed Sep 9 11:20:19 2015 -0400

    Fix MetricWeigher to use MonitorMetricList

    The commit I4dfbea27ce6c3eecc1a8658b1f9dc0feb2298705 changes
    'HostState.metrics' to 'objects.MonitorMetricList'. But MetricWeigher
    still use the old dictionary of 'host_manager.MetricItem'. This patch
    corrects the behavior of MetricWeigher with related tests, and delete
    unused MetricItem.

    Co-Authored-By: Sylvain Bauza <email address hidden>

    Closes-Bug: #1493680
    (cherry picked from commit fd2b868d41a632748939b82ed1b8927adcdfb113)

    Fix NoneType error when calling MetricsWeigher

    (this is a squashed commit since commit fd2b868 was buggy)
    Given that dict comprehensions don't allow to have None as a list, we had
    a problem with the Ironic gate-ironic-inspector-dsvm job because
    host_state.metrics was set to None by default.

    Adding a unittest to make sure we don't regress.

    Closes-Bug: #1499271
    (cherry picked from commit ccea5d6b0ace535b375d3e63bd572885cb5dbc91)

    Change-Id: I9690bc4f6f1dca8f2bf8c5a83f16af6200015506