annuaires: vire mentions câblage crans-crous

This commit is contained in:
Daniel STAN 2015-06-29 01:09:13 +02:00
parent 2bcce4911f
commit 8c8ac24c54
3 changed files with 3 additions and 55 deletions

View file

@ -109,16 +109,6 @@ def reverse(batiment, prise = None):
if not ret:
raise ValueError("Batiment %s inexistant" % batiment)
return ret
@_need_conn
def is_crans(batiment, chambre):
"""Chambre cablee au Cr@ns ?"""
batiment = batiment.lower()
chambre = chambre.lower()
cur = conn.cursor()
cur.execute("SELECT crans FROM prises WHERE (batiment, chambre) = (%s, %s)", (batiment, chambre))
return cur.fetchone()[0]
@_need_conn
def is_connected(batiment, chambre):
"""Cablage physique effectue ?"""
@ -128,18 +118,6 @@ def is_connected(batiment, chambre):
cur.execute("SELECT cablage_effectue FROM prises WHERE (batiment, chambre) = (%s, %s)", (batiment, chambre))
return cur.fetchone()[0]
@_need_conn
def crous_to_crans(batiment, chambre):
"""Passage d'une chambre de CROUS a Cr@ns"""
batiment = batiment.lower()
chambre = chambre.lower()
if is_crans(batiment, chambre):
return
cur = conn.cursor()
cur.execute("UPDATE prises SET (crans, crous, cablage_effectue) = (TRUE, FALSE, not cablage_effectue) WHERE (batiment, chambre) = (%s, %s)", (batiment, chambre))
conn.commit()
cur.close()
# Prises d'uplink, de machines du crans / Prises d'utilité CRANS
uplink_prises={ 'a' :
{ 49 : 'uplink->bata-4', 50 : 'libre-service',