'Check that the host_state provided by the compute service
satisfies the extra specs associated with the instance type.'

def _satisfies_extra_specs(self, host_state, instance_type):

    if ('extra_specs' not in instance_type):
        return True
    for (key, req) in instance_type.extra_specs.items():
        scope = key.split(':')
        if (len(scope) == 1):
            stats = getattr(host_state, 'stats', {})
            has_attr = (hasattr(host_state, key) or (key in stats))
            if (not has_attr):
                continue
        elif (scope[0] != 'capabilities'):
            continue
        else:
            del scope[0]
        cap = self._get_capabilities(host_state, scope)
        if (cap is None):
            return False
        if (not extra_specs_ops.match(str(cap), req)):
            LOG.debug("%(host_state)s    fails    extra_spec    requirements.    '%(req)s'    does    not    match    '%(cap)s'", {'host_state': host_state, 'req': req, 'cap': cap})
            return False
    return True
