6 Commits

Author SHA1 Message Date
Tony Breeds
eb4636f483 Exclude projects under the distributed leadership model
Currently there are 2 leadership types "distributed" and the
Default/unspecified which we treat as the long established PTL model.
Projects that have selected to use the "distributed" model do not
require a PTL election and in fact projects under this model should
reject a PTL nomination as the correct process involves a change the
governance repo.

This change updates 'create-directories' to exclude those projects,
and also updates the ci checks to fail PTL nominations for "distributed"
projects.

Change-Id: Ib4a2ce1e4ee74e8e9a49975017e14172b4d1f576
2023-07-12 15:15:24 +10:00
Hervé Beraud
d113fc7087 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I2f9d4c9a760bd9a9dbb9cde5bcb8af24fd4b34b9
2020-07-24 13:44:46 +02:00
Tony Breeds
041d3a8146 Allow create-directories to be run multiple times
Currently the create-directories tool can only be run once as if the
candidates/<election>/ directory exists it will abort.

If a project is approved by the TC after the directories are created but
before the election start that candidates directory needs to be created
by hand.  Instead change create-directories to only create the
files/directories as needed so it can be run several times.

Change-Id: I62bba67447e2ed91138d6e099b45411cba72be36
2017-01-05 12:57:03 +11:00
Tony Breeds
a3ac4a90f8 Support for running tools under python3
If we run the tools (create-directories or check-all-candidacies) under
python3 they'll fail with silly errors (like[1]).  This is because we
have a number of assumptions they we'll be running under python2 like:

 - pickle.protocol: we done specify one so if we write a pickle file
   from python3 we can't read it in python2.
 - urllib and urlparse: those modules change paths in python 2 or 3 so
   use the six helpers to get the bits we want.
 - Explicitly write files in binary format
 - Various str vs bytes issues
 - dict().keys() returns dict_keys under python3 explictly cast that to
   list()

After addressing these issues we can run the tools under either python2
or python3.  To make this easy to check create explicit ven2 and venv3
test environments, leaving all other testenvs to use the system default.

[1] http://paste.openstack.org/show/593823/
Change-Id: I20334a52500847c810b486c9c8b108e75a5d6303
2017-01-05 12:57:03 +11:00
Tristan Cacqueray
03ff0f697a Add config module
This change is a follow-up to the previous refactor to address the nits.

Change-Id: I2a648c581352b9bcaa69f82f08cd06ed8cbfaa85
2016-12-19 01:21:02 +00:00
Tristan Cacqueray
f6507b695d Import the new-election tool as create-directories
Change-Id: I9a1dc9f22683852af1527449b2b46c2eaf78ad9c
2016-11-09 03:24:18 +00:00