All pastes #558999 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-11 16:11 UTC
rendered paste body
        for hostname in hosts_list:
                hostname = hostname.strip()
                host_site = hostname.split('-', 1)

                if len(host_site) != 2:
                        continue

                host, site = host_site
                type_num_pattern = re.compile(r"([A-Za-z_]+)([0-9]+)")
                type_num_match = type_num_pattern.match(host)
                type, num = type_num_match.groups()
                if site not in constellation:
                        constellation[site] = {}
                if type not in constellation[site]:
                        constellation[site][type] = []

                constellation[site][type].append(num)