[Python/ssh_known_hosts] Typo et meilleur affichage
This commit is contained in:
parent
2f1d1ec6ca
commit
004ca733e9
1 changed files with 7 additions and 5 deletions
|
@ -21,7 +21,7 @@ for machine in machines:
|
|||
key_machines[key.value].add('.'.join(domains[0:2]))
|
||||
for alias in machine['hostAlias']:
|
||||
key_machines[key.value].add(alias.value)
|
||||
domains=host.value.split('.')
|
||||
domains=alias.value.split('.')
|
||||
key_machines[key.value].add(domains[0])
|
||||
key_machines[key.value].add('.'.join(domains[0:2]))
|
||||
for ip in machine['ipHostNumber']:
|
||||
|
@ -30,9 +30,11 @@ for machine in machines:
|
|||
key_machines[key.value].add("%s" % ip)
|
||||
|
||||
# On trie pour avoir des diff valident en appliquant bcfg2 sur les machines
|
||||
keys=key_machines.keys()
|
||||
keys.sort()
|
||||
for key in keys:
|
||||
output=[]
|
||||
for key in key_machines.keys():
|
||||
hosts=list(key_machines[key])
|
||||
hosts.sort()
|
||||
sys.stdout.write("%s %s" % (','.join(hosts),key))
|
||||
output.append("%s %s" % (','.join(hosts),key))
|
||||
|
||||
output.sort()
|
||||
sys.stdout.write("".join(output))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue