Removed hardcoded rewrites - bad idea, and added default .ad's also for working group documents (.group.acronym != 'none').
- Legacy-Id: 5904
This commit is contained in:
parent
e5b551f4ce
commit
e68e51cc55
|
@ -12,57 +12,6 @@ Mailing list alias dumping utilities
|
|||
|
||||
"""
|
||||
|
||||
ad_replacement = {
|
||||
# 2009 Ad replacements
|
||||
'chris.newman@sun.com': 'alexey.melnikov@isode.com',
|
||||
'townsley@cisco.com': 'rdroms@cisco.com',
|
||||
'jon.peterson@neustar.biz': 'rjsparks@nostrum.com',
|
||||
'dward@cisco.com': 'adrian@olddog.co.uk',
|
||||
|
||||
# 2010 AD replacements -- activate after spring ietf
|
||||
'lisa@osafoundation.org': 'stpeter@stpeter.im',
|
||||
'fluffy@cisco.com': 'gonzalo.camarillo@ericsson.com',
|
||||
'rcallon@juniper.net': 'stbryant@cisco.com',
|
||||
'pasi.eronen@nokia.com': 'turners@ieca.com',
|
||||
'magnus.westerlund@ericsson.com': 'ietfdbh@comcast.net',
|
||||
|
||||
# 2011 AD replacements -- activate after spring ietf
|
||||
'alexey.melnikov@isode.com': 'presnick@qualcomm.com',
|
||||
'tim.polk@nist.gov': 'stephen.farrell@cs.tcd.ie',
|
||||
'lars.eggert@nokia.com': 'wes@mti-systems.com',
|
||||
|
||||
#2013 AD replacements
|
||||
'housley@vigilsec.com': 'jari.arkko@piuha.net',
|
||||
'rdroms.ietf@gmail.com': 'ted.lemon@nominum.com',
|
||||
'rbonica@juniper.net': 'jjaeggli@zynga.com',
|
||||
'rjsparks@nostrum.com': 'rbarnes@bbn.com',
|
||||
}
|
||||
|
||||
email_replacement = {
|
||||
'barryleiba@computer.org': 'barryleiba@gmail.com',
|
||||
'greg.daley@eng.monash.edu.au': 'gdaley@netstarnetworks.com',
|
||||
'radia.perlman@sun.com': 'radia@alum.mit.edu',
|
||||
'lisa@osafoundation.org': 'lisa.dusseault@gmail.com',
|
||||
'lisa.dusseault@messagingarchitects.com': 'lisa.dusseault@gmail.com',
|
||||
'scott.lawrence@nortel.com': 'scottlawrenc@avaya.com',
|
||||
'charliep@computer.org': 'charliep@computer.org, charles.perkins@earthlink.net',
|
||||
'yaronf@checkpoint.com': 'yaronf.ietf@gmail.com',
|
||||
'mary.barnes@nortel.com': 'mary.ietf.barnes@gmail.com',
|
||||
'scottlawrenc@avaya.com': 'xmlscott@gmail.com',
|
||||
'henk@ripe.net': 'henk@uijterwaal.nl',
|
||||
'jonne.soininen@nsn.com': 'jonne.soininen@renesasmobile.com',
|
||||
'tom.taylor@rogers.com': 'tom.taylor.stds@gmail.com',
|
||||
'rahul@juniper.net': 'raggarwa_1@yahoo.com',
|
||||
'dward@juniper.net': 'dward@cisco.com',
|
||||
'alan.ford@roke.co.uk': 'alanford@cisco.com',
|
||||
'rod.walsh@nokia.com': 'roderick.walsh@tut.fi',
|
||||
'bob.hinden@nokia.com': 'bob.hinden@gmail.com',
|
||||
'martin.thomson@commscope.com': 'martin.thomson@gmail.com',
|
||||
'rjs@estacado.net': 'rjsparks@nostrum.com',
|
||||
'rbarnes@bbn.com': 'rlb@ipv.sx',
|
||||
}
|
||||
|
||||
|
||||
def rewrite_email_address(email, is_ad):
|
||||
""" Prettify the email address (and if it's empty, skip it by
|
||||
returning None). """
|
||||
|
@ -76,9 +25,6 @@ def rewrite_email_address(email, is_ad):
|
|||
# If it doesn't look like email, skip
|
||||
if '@' not in email and '?' not in email:
|
||||
return
|
||||
if is_ad:
|
||||
email = ad_replacement.get(email, email)
|
||||
email = email_replacement.get(email, email)
|
||||
return email
|
||||
|
||||
def rewrite_address_list(l):
|
||||
|
|
|
@ -37,12 +37,17 @@ from django.core import management
|
|||
management.setup_environ(settings)
|
||||
|
||||
from ietf.doc.models import Document
|
||||
from ietf.group.utils import get_group_chairs_emails
|
||||
from ietf.group.utils import get_group_chairs_emails, get_group_ads_emails
|
||||
from aliasutil import *
|
||||
import time
|
||||
|
||||
def get_draft_ad_emails(draft):
|
||||
" Get AD email for the given draft, if any. "
|
||||
# If working group document, return current WG ADs
|
||||
wg = draft.group
|
||||
if wg and wg.acronym != 'none' and wg.parent and wg.parent.acronym != 'none':
|
||||
return get_group_ads_emails(wg)
|
||||
# If not, return explicit AD set (whether up to date or not)
|
||||
ad = draft.ad
|
||||
#return [ad and ad.user and ad.user.email]
|
||||
return [ad and ad.email_address()]
|
||||
|
@ -123,11 +128,12 @@ if __name__ == '__main__':
|
|||
continue
|
||||
handle_sublist('%s%s' % (name, '.authors'), get_draft_authors_emails, draft)
|
||||
wg = draft.group
|
||||
|
||||
if wg:
|
||||
# .chairs = WG chairs
|
||||
handle_sublist('%s%s' % (name, '.chairs'), get_group_chairs_emails, wg)
|
||||
|
||||
# .ad = sponsoring AD
|
||||
# .ad = sponsoring AD / WG AD (WG document)
|
||||
handle_sublist('%s%s' % (name, '.ad'), get_draft_ad_emails, draft, True)
|
||||
|
||||
# .notify = notify email list from the Document
|
||||
|
|
|
@ -50,13 +50,18 @@ def get_charter_text(group):
|
|||
return desc
|
||||
|
||||
def get_area_ads_emails(area):
|
||||
if area.acronym == 'none':
|
||||
return []
|
||||
emails = [r.email.email_address()
|
||||
for r in area.role_set.filter(name__in=('ad', 'chair'))]
|
||||
return filter(None, emails)
|
||||
|
||||
def get_group_ads_emails(wg):
|
||||
" Get list of area directors' emails for a given WG "
|
||||
if wg.parent:
|
||||
if wg.acronym == 'none':
|
||||
return []
|
||||
|
||||
if wg.parent and wg.parent.acronym != 'none':
|
||||
# By default, we should use _current_ list of ads!
|
||||
return get_area_ads_emails(wg.parent)
|
||||
|
||||
|
@ -65,6 +70,8 @@ def get_group_ads_emails(wg):
|
|||
|
||||
def get_group_chairs_emails(wg):
|
||||
" Get list of area chairs' emails for a given WG "
|
||||
if wg.acronym == 'none':
|
||||
return []
|
||||
emails = Email.objects.filter(role__group=wg,
|
||||
role__name='chair')
|
||||
if not emails:
|
||||
|
|
Loading…
Reference in a new issue