[ssh_known_hosts] Ajout des domaine partiel (machin.adm) et des ipv6. On trie la sortie pour avoir des diff cohérents
Ignore-this: 42da539dfc78d9fd096c29c459f964a8 darcs-hash:20130208000414-3a55a-7acd0447d7185dd83b19bbbc4fc649bb870db4a0.gz
This commit is contained in:
parent
0e762fcbde
commit
69a1e6c040
1 changed files with 16 additions and 4 deletions
|
@ -22,11 +22,23 @@ for machine in machines:
|
|||
key_machines[key.value]=set()
|
||||
for host in machine['host']:
|
||||
key_machines[key.value].add(host.value)
|
||||
key_machines[key.value].add(host.value.split('.')[0])
|
||||
domains=host.value.split('.')
|
||||
key_machines[key.value].add(domains[0])
|
||||
key_machines[key.value].add('.'.join(domains[0:2]))
|
||||
for alias in machine['hostAlias']:
|
||||
key_machines[key.value].add(alias.value)
|
||||
key_machines[key.value].add(alias.value.split('.')[0])
|
||||
domains=host.value.split('.')
|
||||
key_machines[key.value].add(domains[0])
|
||||
key_machines[key.value].add('.'.join(domains[0:2]))
|
||||
for ip in machine['ipHostNumber']:
|
||||
key_machines[key.value].add("%s" % ip)
|
||||
for key,hosts in key_machines.items():
|
||||
sys.stdout.write("%s %s" % (','.join(hosts),key))
|
||||
for ip in machine['ip6HostNumber']:
|
||||
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:
|
||||
hosts=list(key_machines[key])
|
||||
hosts.sort()
|
||||
sys.stdout.write("%s %s" % (','.join(hosts),key))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue