'Helper method to parse the node\'s instance info.
If a property cannot be looked up via instance_info, use the original
value from the properties dict. This is most likely to be correct;
it should only be incorrect if the properties were changed directly
in Ironic while an instance was deployed.'

def _parse_node_instance_info(self, node, props):

    instance_info = {}
    props['vcpus'] = props['cpus']
    for prop in ('vcpus', 'memory_mb', 'local_gb'):
        original = props[prop]
        try:
            instance_info[prop] = int(node.instance_info.get(prop, original))
        except (TypeError, ValueError):
            LOG.warning('Node    %(uuid)s    has    a    malformed    "%(prop)s".    It    should    be    an    integer    but    its    value    is    "%(value)s".', {'uuid': node.uuid, 'prop': prop, 'value': node.instance_info.get(prop)})
            instance_info[prop] = original
    return instance_info
