Prepare Ocata election
This change also includes a new tool to automate election preparation Change-Id: I98049db7c0b665992d408c78e62e99f4a36e3a60
This commit is contained in:
parent
9010a495c6
commit
be2a3afc4c
3
.gitignore
vendored
3
.gitignore
vendored
@ -11,4 +11,5 @@ ChangeLog
|
||||
candidates/ptl.rst
|
||||
candidates/tc.rst
|
||||
candidates/events.rst
|
||||
.projects.yaml
|
||||
.projects*yaml
|
||||
.projects*.pkl
|
||||
|
0
candidates/ocata/Astara/.placeholder
Normal file
0
candidates/ocata/Astara/.placeholder
Normal file
0
candidates/ocata/Barbican/.placeholder
Normal file
0
candidates/ocata/Barbican/.placeholder
Normal file
0
candidates/ocata/Chef_OpenStack/.placeholder
Normal file
0
candidates/ocata/Chef_OpenStack/.placeholder
Normal file
0
candidates/ocata/Cinder/.placeholder
Normal file
0
candidates/ocata/Cinder/.placeholder
Normal file
0
candidates/ocata/Cloudkitty/.placeholder
Normal file
0
candidates/ocata/Cloudkitty/.placeholder
Normal file
0
candidates/ocata/Community_App_Catalog/.placeholder
Normal file
0
candidates/ocata/Community_App_Catalog/.placeholder
Normal file
0
candidates/ocata/Congress/.placeholder
Normal file
0
candidates/ocata/Congress/.placeholder
Normal file
0
candidates/ocata/Designate/.placeholder
Normal file
0
candidates/ocata/Designate/.placeholder
Normal file
0
candidates/ocata/Documentation/.placeholder
Normal file
0
candidates/ocata/Documentation/.placeholder
Normal file
0
candidates/ocata/Dragonflow/.placeholder
Normal file
0
candidates/ocata/Dragonflow/.placeholder
Normal file
0
candidates/ocata/Ec2_Api/.placeholder
Normal file
0
candidates/ocata/Ec2_Api/.placeholder
Normal file
0
candidates/ocata/Freezer/.placeholder
Normal file
0
candidates/ocata/Freezer/.placeholder
Normal file
0
candidates/ocata/Fuel/.placeholder
Normal file
0
candidates/ocata/Fuel/.placeholder
Normal file
0
candidates/ocata/Glance/.placeholder
Normal file
0
candidates/ocata/Glance/.placeholder
Normal file
0
candidates/ocata/Heat/.placeholder
Normal file
0
candidates/ocata/Heat/.placeholder
Normal file
0
candidates/ocata/Horizon/.placeholder
Normal file
0
candidates/ocata/Horizon/.placeholder
Normal file
0
candidates/ocata/I18n/.placeholder
Normal file
0
candidates/ocata/I18n/.placeholder
Normal file
0
candidates/ocata/Infrastructure/.placeholder
Normal file
0
candidates/ocata/Infrastructure/.placeholder
Normal file
0
candidates/ocata/Ironic/.placeholder
Normal file
0
candidates/ocata/Ironic/.placeholder
Normal file
0
candidates/ocata/Keystone/.placeholder
Normal file
0
candidates/ocata/Keystone/.placeholder
Normal file
0
candidates/ocata/Kolla/.placeholder
Normal file
0
candidates/ocata/Kolla/.placeholder
Normal file
0
candidates/ocata/Kuryr/.placeholder
Normal file
0
candidates/ocata/Kuryr/.placeholder
Normal file
0
candidates/ocata/Magnum/.placeholder
Normal file
0
candidates/ocata/Magnum/.placeholder
Normal file
0
candidates/ocata/Manila/.placeholder
Normal file
0
candidates/ocata/Manila/.placeholder
Normal file
0
candidates/ocata/Mistral/.placeholder
Normal file
0
candidates/ocata/Mistral/.placeholder
Normal file
0
candidates/ocata/Monasca/.placeholder
Normal file
0
candidates/ocata/Monasca/.placeholder
Normal file
0
candidates/ocata/Murano/.placeholder
Normal file
0
candidates/ocata/Murano/.placeholder
Normal file
0
candidates/ocata/Neutron/.placeholder
Normal file
0
candidates/ocata/Neutron/.placeholder
Normal file
0
candidates/ocata/Nova/.placeholder
Normal file
0
candidates/ocata/Nova/.placeholder
Normal file
0
candidates/ocata/OpenStackAnsible/.placeholder
Normal file
0
candidates/ocata/OpenStackAnsible/.placeholder
Normal file
0
candidates/ocata/OpenStackClient/.placeholder
Normal file
0
candidates/ocata/OpenStackClient/.placeholder
Normal file
0
candidates/ocata/OpenStackSalt/.placeholder
Normal file
0
candidates/ocata/OpenStackSalt/.placeholder
Normal file
0
candidates/ocata/OpenStack_Charms/.placeholder
Normal file
0
candidates/ocata/OpenStack_Charms/.placeholder
Normal file
0
candidates/ocata/OpenStack_UX/.placeholder
Normal file
0
candidates/ocata/OpenStack_UX/.placeholder
Normal file
0
candidates/ocata/Oslo/.placeholder
Normal file
0
candidates/ocata/Oslo/.placeholder
Normal file
0
candidates/ocata/Packaging_Deb/.placeholder
Normal file
0
candidates/ocata/Packaging_Deb/.placeholder
Normal file
0
candidates/ocata/Packaging_Rpm/.placeholder
Normal file
0
candidates/ocata/Packaging_Rpm/.placeholder
Normal file
0
candidates/ocata/Puppet_OpenStack/.placeholder
Normal file
0
candidates/ocata/Puppet_OpenStack/.placeholder
Normal file
0
candidates/ocata/Quality_Assurance/.placeholder
Normal file
0
candidates/ocata/Quality_Assurance/.placeholder
Normal file
0
candidates/ocata/Rally/.placeholder
Normal file
0
candidates/ocata/Rally/.placeholder
Normal file
0
candidates/ocata/RefStack/.placeholder
Normal file
0
candidates/ocata/RefStack/.placeholder
Normal file
0
candidates/ocata/Release_Management/.placeholder
Normal file
0
candidates/ocata/Release_Management/.placeholder
Normal file
0
candidates/ocata/Requirements/.placeholder
Normal file
0
candidates/ocata/Requirements/.placeholder
Normal file
0
candidates/ocata/Sahara/.placeholder
Normal file
0
candidates/ocata/Sahara/.placeholder
Normal file
0
candidates/ocata/Searchlight/.placeholder
Normal file
0
candidates/ocata/Searchlight/.placeholder
Normal file
0
candidates/ocata/Security/.placeholder
Normal file
0
candidates/ocata/Security/.placeholder
Normal file
0
candidates/ocata/Senlin/.placeholder
Normal file
0
candidates/ocata/Senlin/.placeholder
Normal file
0
candidates/ocata/Smaug/.placeholder
Normal file
0
candidates/ocata/Smaug/.placeholder
Normal file
0
candidates/ocata/Solum/.placeholder
Normal file
0
candidates/ocata/Solum/.placeholder
Normal file
0
candidates/ocata/Swift/.placeholder
Normal file
0
candidates/ocata/Swift/.placeholder
Normal file
0
candidates/ocata/TC/.placeholder
Normal file
0
candidates/ocata/TC/.placeholder
Normal file
0
candidates/ocata/Tacker/.placeholder
Normal file
0
candidates/ocata/Tacker/.placeholder
Normal file
0
candidates/ocata/Telemetry/.placeholder
Normal file
0
candidates/ocata/Telemetry/.placeholder
Normal file
0
candidates/ocata/Tripleo/.placeholder
Normal file
0
candidates/ocata/Tripleo/.placeholder
Normal file
0
candidates/ocata/Trove/.placeholder
Normal file
0
candidates/ocata/Trove/.placeholder
Normal file
0
candidates/ocata/Vitrage/.placeholder
Normal file
0
candidates/ocata/Vitrage/.placeholder
Normal file
0
candidates/ocata/Watcher/.placeholder
Normal file
0
candidates/ocata/Watcher/.placeholder
Normal file
0
candidates/ocata/Winstackers/.placeholder
Normal file
0
candidates/ocata/Winstackers/.placeholder
Normal file
0
candidates/ocata/Zaqar/.placeholder
Normal file
0
candidates/ocata/Zaqar/.placeholder
Normal file
@ -66,8 +66,8 @@ def render_list(list_type, candidates_list):
|
||||
|
||||
|
||||
def build_lists(app):
|
||||
# TODO: make newton a parameter
|
||||
election = 'newton'
|
||||
# TODO: make election a parameter
|
||||
election = 'ocata'
|
||||
candidates_list = build_candidates_list(election)
|
||||
render_list("ptl", candidates_list)
|
||||
render_list("tc", candidates_list)
|
||||
|
@ -2,7 +2,7 @@
|
||||
OpenStack Election
|
||||
==================
|
||||
|
||||
.. warning:: This is a test for Newton cycle
|
||||
.. warning:: This is a test for Ocata cycle
|
||||
|
||||
.. include:: ./candidates/events.rst
|
||||
|
||||
@ -10,7 +10,7 @@ See PTL_details_ and TC_details_.
|
||||
|
||||
Below is the official list of candidates for the current round.
|
||||
|
||||
.. include:: ./candidates/tc.rst
|
||||
.. include:: ./candidates/ptl.rst
|
||||
|
||||
|
||||
Election Officials
|
||||
|
16
events.yaml
16
events.yaml
@ -1,8 +1,8 @@
|
||||
- {'date': '2016-03-11T00:00', 'name': 'PTL nomination starts'}
|
||||
- {'date': '2016-03-17T23:59', 'name': 'PTL nomination ends'}
|
||||
- {'date': '2016-03-18T00:00', 'name': 'PTL elections begins'}
|
||||
- {'date': '2016-03-24T23:59', 'name': 'PTL elections ends'}
|
||||
- {'date': '2016-03-25T00:00', 'name': 'TC nomination starts'}
|
||||
- {'date': '2016-03-31T23:59', 'name': 'TC nomination ends'}
|
||||
- {'date': '2016-04-01T00:00', 'name': 'TC elections begins'}
|
||||
- {'date': '2016-04-07T23:59', 'name': 'TC elections ends'}
|
||||
- {'date': '2016-09-12T00:00', 'name': 'PTL nomination starts'}
|
||||
- {'date': '2016-09-18T23:45', 'name': 'PTL nomination ends'}
|
||||
- {'date': '2016-09-19T00:00', 'name': 'PTL elections begins'}
|
||||
- {'date': '2016-09-25T23:45', 'name': 'PTL elections ends'}
|
||||
- {'date': '2016-09-26T00:00', 'name': 'TC nomination starts'}
|
||||
- {'date': '2016-10-01T23:45', 'name': 'TC nomination ends'}
|
||||
- {'date': '2016-10-03T00:00', 'name': 'TC elections begins'}
|
||||
- {'date': '2016-10-08T23:45', 'name': 'TC elections ends'}
|
||||
|
43
tools/new-election.py
Executable file
43
tools/new-election.py
Executable file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
|
||||
from utils import get_projects, name2dir
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('name', help='The release cycle name')
|
||||
parser.add_argument("--root", help='Election directory', default='.')
|
||||
options = parser.parse_args()
|
||||
|
||||
os.chdir(options.root)
|
||||
if not os.path.isdir("candidates"):
|
||||
print "candidates directory not found"
|
||||
exit(1)
|
||||
|
||||
if os.path.exists("candidates/%s" % options.name):
|
||||
print "candidates/%s: directory already exists" % options.name
|
||||
exit(1)
|
||||
|
||||
projects = get_projects()
|
||||
project_list = projects.keys()
|
||||
project_list.sort()
|
||||
for project in project_list + ["TC"]:
|
||||
dpath = "candidates/%s/%s" % (options.name, name2dir(project))
|
||||
os.makedirs(dpath)
|
||||
open("%s/.placeholder" % dpath, "w").close()
|
||||
print "[+] Created %s" % dpath
|
||||
|
||||
print "Done. Now please manually update events.yaml and doc/source/index.rst substitutions"
|
57
tools/utils.py
Normal file
57
tools/utils.py
Normal file
@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import os
|
||||
import time
|
||||
import urllib
|
||||
import yaml
|
||||
import pickle
|
||||
|
||||
BASE_URL = 'https://git.openstack.org/cgit'
|
||||
PROJECTS_URL = ('%s/openstack/governance/plain/reference/projects.yaml' %
|
||||
(BASE_URL))
|
||||
|
||||
|
||||
def get_projects(tag=None):
|
||||
url = PROJECTS_URL
|
||||
cache_file = '.projects.pkl'
|
||||
|
||||
if tag:
|
||||
url += '?%s' % tag
|
||||
cache_file = '.projects.%s.pkl' % tag
|
||||
|
||||
# Refresh the cache if it's not there or if it's older than a week
|
||||
if (not os.path.isfile(cache_file) or
|
||||
os.stat(cache_file).st_size < 100 or
|
||||
os.stat(cache_file).st_mtime + (7*24*3600) < time.time()):
|
||||
print "[+] Updating %s" % cache_file
|
||||
data = yaml.safe_load(urllib.urlopen(url).read())
|
||||
pickle.dump(data, open(cache_file, "w"))
|
||||
|
||||
return pickle.load(open(cache_file))
|
||||
|
||||
|
||||
def name2dir(name):
|
||||
"""Convert project name to directory name: only [a-zA-Z_] in camelcase"""
|
||||
name = name.replace(' ', '_').replace('-', '_')
|
||||
return "_".join(map(lambda x: x[0].upper()+x[1:], name.split('_')))
|
||||
|
||||
|
||||
def dir2name(name, projects):
|
||||
"""Convert directory name to original project name"""
|
||||
name = name.replace('_', '').lower()
|
||||
for project_name in projects:
|
||||
pname = project_name.lower().replace(' ', '').replace('-', '').lower()
|
||||
if name == pname:
|
||||
return project_name
|
Loading…
Reference in New Issue
Block a user