[gen_confs/surveillance.py] Passage à psycopg2
Ignore-this: 36e4322e837e6864ac15794a299bc32b darcs-hash:20130126225134-afe24-223d0eea0b7dc5f764718e563f2f79f5b0a24d65.gz
This commit is contained in:
parent
bff0c9f555
commit
54749b0d63
1 changed files with 5 additions and 6 deletions
|
@ -14,7 +14,7 @@ import sys, os, commands
|
|||
sys.path.append('/usr/scripts/gestion')
|
||||
from ldap_crans import crans_ldap, Club, Adherent, AssociationCrans
|
||||
from gen_confs import gen_config
|
||||
from pyPgSQL import PgSQL
|
||||
import psycopg2
|
||||
|
||||
db = crans_ldap()
|
||||
|
||||
|
@ -32,8 +32,7 @@ class exemptions(gen_config) :
|
|||
def _gen (self) :
|
||||
|
||||
machines = db.search('exempt=*')['machine']
|
||||
|
||||
pgsql = PgSQL.connect(host='/var/run/postgresql', database='filtrage', user='crans')
|
||||
pgsql = psycopg2.connect(database='filtrage', user='crans')
|
||||
curseur = pgsql.cursor()
|
||||
|
||||
requete="DELETE FROM exemptes"
|
||||
|
@ -68,12 +67,12 @@ class machines(gen_config) :
|
|||
machines = db.search('ip=*')['machine']
|
||||
|
||||
# liste des machines (on prend que les paimement ok)
|
||||
machines = self.machines
|
||||
# machines = self.machines
|
||||
# machines = db.search('ip=*')['machine']
|
||||
|
||||
# connexion à la base postgresql
|
||||
from pyPgSQL import PgSQL
|
||||
pgsql = PgSQL.connect(host='/var/run/postgresql', database='filtrage', user='crans')
|
||||
import psycopg2
|
||||
pgsql = psycopg2.connect(database='filtrage', user='crans')
|
||||
curseur = pgsql.cursor()
|
||||
curseur.execute("DELETE FROM machines;")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue