summaryrefslogtreecommitdiffstats
path: root/openstack/common
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-17 13:12:18 +0000
committerGerrit Code Review <review@openstack.org>2013-01-17 13:12:18 +0000
commit82e86045b50e5b66f5acdaf402f53db229c947eb (patch)
tree1fc7e850e135cae64b93c37607c20fea38a6bbea /openstack/common
parent93aacfa8eff3fa04578313c717de7ed2c28a51ef (diff)
parent1e81f95ca79d5a1b79bc86f710666148d1a5a385 (diff)
downloadoslo-82e86045b50e5b66f5acdaf402f53db229c947eb.tar.gz
oslo-82e86045b50e5b66f5acdaf402f53db229c947eb.tar.xz
oslo-82e86045b50e5b66f5acdaf402f53db229c947eb.zip
Merge "use regexp to parse the mailmap"
Diffstat (limited to 'openstack/common')
-rw-r--r--openstack/common/setup.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/openstack/common/setup.py b/openstack/common/setup.py
index 32f093f..13cf000 100644
--- a/openstack/common/setup.py
+++ b/openstack/common/setup.py
@@ -34,11 +34,12 @@ def parse_mailmap(mailmap='.mailmap'):
if os.path.exists(mailmap):
with open(mailmap, 'r') as fp:
for l in fp:
- l = l.strip()
- if not l.startswith('#') and ' ' in l:
- canonical_email, alias = [x for x in l.split(' ')
- if x.startswith('<')]
- mapping[alias] = canonical_email
+ try:
+ canonical_email, alias = re.match(
+ r'[^#]*?(<.+>).*(<.+>).*', l).groups()
+ except AttributeError:
+ continue
+ mapping[alias] = canonical_email
return mapping