'Checks a host in an aggregate that metadata key/value match
with image properties.'

def host_passes(self, host_state, spec_obj):

    cfg_namespace = CONF.filter_scheduler.aggregate_image_properties_isolation_namespace
    cfg_separator = CONF.filter_scheduler.aggregate_image_properties_isolation_separator
    image_props = (spec_obj.image.properties if spec_obj.image else {})
    metadata = utils.aggregate_metadata_get_by_host(host_state)
    for (key, options) in metadata.items():
        if (cfg_namespace and (not key.startswith((cfg_namespace + cfg_separator)))):
            continue
        prop = None
        try:
            prop = image_props.get(key)
        except AttributeError:
            LOG.warning(_LW("Host    '%(host)s'    has    a    metadata    key    '%(key)s'    that    is    not    present    in    the    image    metadata."), {'host': host_state.host, 'key': key})
            continue
        if (prop and (str(prop) not in options)):
            LOG.debug('%(host_state)s    fails    image    aggregate    properties    requirements.    Property    %(prop)s    does    not    match    %(options)s.', {'host_state': host_state, 'prop': prop, 'options': options})
            return False
    return True
