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)
|
socket.gethostbyname(hostname)
|
||||||
except socket.gaierror:
|
except socket.gaierror:
|
||||||
return False
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def liste_chambres_macs(switch, annuaire):
|
def liste_chambres_macs(switch, annuaire):
|
||||||
u'''
|
u'''
|
||||||
|
@ -40,7 +41,7 @@ def liste_chambres_macs(switch, annuaire):
|
||||||
'''
|
'''
|
||||||
liste_bats = ['a', 'b', 'c', 'g', 'h', 'i', 'j', 'm', 'p']
|
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])
|
bat, num_switch = split[0][-1], int(split[1][0])
|
||||||
if bat not in liste_bats:
|
if bat not in liste_bats:
|
||||||
return {}
|
return {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue