Ejemplo n.º 1
0
    def GrabDNS(self, domain, environment, local=False, revision=None):
        """
        GrabDNS with a local option. If local is true,
        it reads from the local couchdb instance.

        The reivision represents the couchdb revision.
        """
        if local:
            couch = CouchHelper('http://localhost:5984', 'nodetraq')
            view = couch.get_view('dns', 'configs')
            for row in view:
                if row.value.has_key('config'):
                    self.ImportDNS(row.value['config'], row.value['token'])
                    break
        else:
            self.dns = self.dns_get_conf(domain, environment)
Ejemplo n.º 2
0
    def GrabDNS(self, domain, environment,
                local=False, revision=None):
        """
        GrabDNS with a local option. If local is true,
        it reads from the local couchdb instance.

        The reivision represents the couchdb revision.
        """
        if local:
            couch = CouchHelper('http://localhost:5984', 'nodetraq')
            view = couch.get_view('dns', 'configs')
            for row in view:
                if row.value.has_key('config'):
                    self.ImportDNS(row.value['config'], row.value['token'])
                    break
        else:
            self.dns = self.dns_get_conf(domain, environment)