def should_use_agent(instance):
    sys_meta = utils.instance_sys_meta(instance)
    if USE_AGENT_SM_KEY not in sys_meta:
        return CONF.xenserver.use_agent_default
    else:
        use_agent_raw = sys_meta[USE_AGENT_SM_KEY]
        try:
            return strutils.bool_from_string(use_agent_raw, strict=True)
        except __HOLE__:
            LOG.warning(_LW("Invalid 'agent_present' value. "
                            "Falling back to the default."),
                        instance=instance)
            return CONF.xenserver.use_agent_default
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/agent.py/should_use_agent