Fix project list match with directory name

This change reverse the directory name creation to find
projects name back from projects.yaml.

Directories were created using:
for project in projects.keys():
  os.mkdir(project.title().replace(' ', '_'))

Also fix DATE_MAX to match Liberty-Mitaka timeframe.

Change-Id: I51cb272807e2b68f794b939319c198736722f340
This commit is contained in:
Tristan Cacqueray 2016-03-13 10:18:05 -04:00
parent d61e58fc9e
commit c0f7aade5a

View File

@ -7,10 +7,9 @@ import urllib
import re
import datetime
import pytz
import string
DATE_MIN = '2015-03-04'
DATE_MAX = '2016-01-03'
DATE_MAX = '2016-03-03'
BASE_URL = 'https://git.openstack.org/cgit'
PROJECTS_TAG = 'march-2016-elections'
@ -67,12 +66,9 @@ if project_name == "TC":
project_list = projects.values()
else:
for key in projects.keys():
for dirname in [key, string.capwords(key, '-'),
key.replace(' ', '_'),
string.capwords(key.replace(' ', '_'), '_')]:
if dirname == project_name:
project_list = [projects[key]]
break
if key.title().replace(' ', '_') == project_name:
project_list = [projects[key]]
break
if project_list is None:
print "Can't find project [%s] in %s" % (project_name, projects.keys())