host_exists ne marchait pas, le patch pour batb-5 avait coupé mac_prises
This commit is contained in:
parent
6f52c57431
commit
df4d564ffb
2 changed files with 3 additions and 2 deletions
|
@ -30,6 +30,7 @@ def host_exists(hostname):
|
|||
socket.gethostbyname(hostname)
|
||||
except socket.gaierror:
|
||||
return False
|
||||
return True
|
||||
|
||||
def liste_chambres_macs(switch, annuaire):
|
||||
u'''
|
||||
|
@ -40,7 +41,7 @@ def liste_chambres_macs(switch, annuaire):
|
|||
'''
|
||||
liste_bats = ['a', 'b', 'c', 'g', 'h', 'i', 'j', 'm', 'p']
|
||||
|
||||
split = switch.replace('.adm.crans.org', '').split('-')
|
||||
split = switch.split(".")[0].split('-')
|
||||
bat, num_switch = split[0][-1], int(split[1][0])
|
||||
if bat not in liste_bats:
|
||||
return {}
|
||||
|
|
|
@ -76,7 +76,7 @@ if __name__ == '__main__':
|
|||
# parallélise vraiment !
|
||||
for switch in switches:
|
||||
output[switch] = threads[switch].output()
|
||||
|
||||
|
||||
curseur = get_curseur(time.time())
|
||||
|
||||
requete = "INSERT INTO correspondance (date, chambre, mac) VALUES (%s, %s, %s);"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue