Merged in [18993] from housley@vigilsec.com:

Add aliases for RGs in irtf.org and IAB programs in iab.org. Fixes #3271
 - Legacy-Id: 19021
Note: SVN reference [18993] has been migrated to Git commit 886b99c273
This commit is contained in:
Robert Sparks 2021-05-20 20:14:49 +00:00
commit ed68a97685

View file

@ -20,9 +20,12 @@ from ietf.name.models import GroupTypeName
from ietf.utils.aliases import dump_sublist
DEFAULT_YEARS = 5
ACTIVE_STATES=['active', 'bof', 'proposed']
ACTIVE_STATES=['active','bof','proposed']
GROUP_TYPES=['wg','rg','dir','team','review','program']
NO_AD_GROUP_TYPES=['rg','team','program']
IETF_DOMAIN=['ietf.org', ]
IRTF_DOMAIN=['irtf.org', ]
IAB_DOMAIN=['iab.org', ]
class Command(BaseCommand):
help = ('Generate the group-aliases and group-virtual files for Internet-Draft '
@ -44,10 +47,15 @@ class Command(BaseCommand):
vfile.write(signature)
vfile.write("%s anything\n" % settings.GROUP_VIRTUAL_DOMAIN)
alias_domains = ['ietf.org', ]
# Loop through each group type and build -ads and -chairs entries
for g in GROUP_TYPES:
domains = []
domains += IETF_DOMAIN
if g == 'rg':
domains += IRTF_DOMAIN
if g == 'program':
domains += IAB_DOMAIN
entries = Group.objects.filter(type=g).all()
active_entries = entries.filter(state__in=ACTIVE_STATES)
inactive_recent_entries = entries.exclude(state__in=ACTIVE_STATES).filter(time__gte=show_since)
@ -55,11 +63,12 @@ class Command(BaseCommand):
for e in interesting_entries.distinct().iterator():
name = e.acronym
# Research groups, teams, and programs do not have -ads lists
if not g in NO_AD_GROUP_TYPES:
dump_sublist(afile, vfile, name+'-ads', ['ietf.org', ], settings.GROUP_VIRTUAL_DOMAIN, get_group_ad_emails(e))
dump_sublist(afile, vfile, name+'-ads', domains, settings.GROUP_VIRTUAL_DOMAIN, get_group_ad_emails(e))
# All group types have -chairs lists
dump_sublist(afile, vfile, name+'-chairs', ['ietf.org', ], settings.GROUP_VIRTUAL_DOMAIN, get_group_role_emails(e, ['chair', 'secr']))
dump_sublist(afile, vfile, name+'-chairs', domains, settings.GROUP_VIRTUAL_DOMAIN, get_group_role_emails(e, ['chair', 'secr']))
# The area lists include every chair in active working groups in the area
areas = Group.objects.filter(type='area').all()
@ -67,14 +76,14 @@ class Command(BaseCommand):
for area in active_areas:
name = area.acronym
area_ad_emails = get_group_role_emails(area, ['pre-ad', 'ad', 'chair'])
dump_sublist(afile, vfile, name+'-ads', alias_domains, settings.GROUP_VIRTUAL_DOMAIN, area_ad_emails)
dump_sublist(afile, vfile, name+'-chairs', alias_domains, settings.GROUP_VIRTUAL_DOMAIN, (get_child_group_role_emails(area, ['chair', 'secr']) | area_ad_emails))
dump_sublist(afile, vfile, name+'-ads', IETF_DOMAIN, settings.GROUP_VIRTUAL_DOMAIN, area_ad_emails)
dump_sublist(afile, vfile, name+'-chairs', IETF_DOMAIN, settings.GROUP_VIRTUAL_DOMAIN, (get_child_group_role_emails(area, ['chair', 'secr']) | area_ad_emails))
# Other groups with chairs that require Internet-Draft submission approval
gtypes = GroupTypeName.objects.values_list('slug', flat=True)
special_groups = Group.objects.filter(type__features__req_subm_approval=True, acronym__in=gtypes, state='active')
for group in special_groups:
dump_sublist(afile, vfile, group.acronym+'-chairs', alias_domains, settings.GROUP_VIRTUAL_DOMAIN, get_group_role_emails(group, ['chair', 'delegate']))
dump_sublist(afile, vfile, group.acronym+'-chairs', IETF_DOMAIN, settings.GROUP_VIRTUAL_DOMAIN, get_group_role_emails(group, ['chair', 'delegate']))
afile.close()
vfile.close()