@classmethod
    def should_enable_metadata(cls, conf, network):
        if conf.force_metadata:
            return True

        if conf.enable_metadata_network and conf.enable_isolated_metadata:
            # check if the network has a metadata subnet
            meta_cidr = netaddr.IPNetwork(METADATA_DEFAULT_CIDR)
            if any(netaddr.IPNetwork(s.cidr) in meta_cidr
                   for s in network.subnets):
                return True

        if not conf.enable_isolated_metadata:
            return False

        isolated_subnets = cls.get_isolated_subnets(network)
        return any(isolated_subnets[subnet.id] for subnet in network.subnets)
Restore the original value of L{pamauth.callIntoPAM}.
dataset/ETHPy150Open openstack/neutron/neutron/agent/linux/dhcp.py/Dnsmasq.should_enable_metadata--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_newcred.py/PluggableAuthenticationModulesTest.tearDown