If a Python file is meant to be executed (as opposed to imported), it should have a .in extension, and its first line should be:
#!@PYTHON@
which will be replaced with the appropriate python executable when Pacemaker is built. To make that happen, add an entry to CONFIG_FILES_EXEC() in configure.ac, and add the file name without .in to .gitignore (see existing examples).
After the above line if any, every Python file should start like this:
""" <BRIEF-DESCRIPTION>
"""
__copyright__ = "Copyright <YYYY[-YYYY]> the Pacemaker project contributors"
__license__ = "<LICENSE> WITHOUT ANY WARRANTY"
<BRIEF-DESCRIPTION> is obviously a brief description of the file’s purpose. The string may contain any other information typically used in a Python file docstring [https://www.python.org/dev/peps/pep-0257/].
<LICENSE> should follow the policy set forth in the COPYING [https://github.com/ClusterLabs/pacemaker/blob/master/COPYING] file, generally one of “GNU General Public License version 2 or later (GPLv2+)” or “GNU Lesser General Public License version 2.1 or later (LGPLv2.1+)”.
Pacemaker targets compatibility with Python 3.4 and later.
Do not use features not available in all targeted Python versions. An example is the subprocess.run() function.