| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
The PKI CLI has been modified to support cascading configuration
files: default, system-wide, and user-specific configuration.
The existing Python-based PKI CLI was moved into pki.cli.main
module. A new shell script was added as a replacement which will
read the configuration files and invoke the Python module.
|
|
|
|
|
|
|
|
|
|
|
| |
Fedora 24 has Python 3.5 instead of Python 3.4. tox.ini now uses python3
to use any Python 3 interpreter.
Python 3.5 has unittest.mock in the stdlib. Tests must attempt to import
mock from unittest first.
Pylint 1.5 has deprecated a couple of old options. Dogtag doesn't use
the options anyway. I just removed them from dogtag.pylintrc.
|
|
|
|
|
| |
I forgot to decode the output of subprocess.check_call(). All other
places decode bytes to text properly.
|
|
|
|
| |
https://fedorahosted.org/pki/ticket/1738
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Python 3's exception class has no message attribute. e.message can
either be replaced with string representation of e or e.args[0].
Use print(line, end='') instead of sys.stdout.write(). With end='' no
new line is appended.
Use six.reraise() to reraise an exception.
Remove sys.exc_clear() as it is no longer available in Python 3.
Conditionally import shutil.WindowsError.
Use six.move to import correct modules / function like quote, urlparse
and configparser.
Silence some pylint warnings. pylint doesn't understand six.moves magic
and emits a import-error warning.
Add additional tox envs to check for Python 3 compatibility.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enforce absolute imports or explicit relative imports. Python 3 no
longer supports implicit relative imports, that is unqualified imports
from a module's directory. In order to load a module from the same
directory inside a package, use
from . import module
The future feature 'from __future__ import absolute_import' ensures that
pki uses absolute imports on Python 2, too.
See https://www.python.org/dev/peps/pep-0328/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Large portions of the patch was automatically created with autopep8:
find base/ -name '*.py' | xargs autopep8 --in-place --ignore E309 \
--aggressive
find base/common/upgrade base/server/upgrade -type f -and \
-not -name .gitignore | autopep8 --in-place --ignore E309 --aggressive
autopep8 --in-place --ignore E309 --aggressive \
base/common/sbin/pki-upgrade \
base/server/sbin/pkispawn \
base/server/sbin/pkidestroy \
base/server/sbin/pki-server \
base/server/sbin/pki-server-upgrade
About two dozent violations were fixed manually.
https://fedorahosted.org/pki/ticket/708
|
|
|
|
|
|
| |
Move internal helper and its configuration out of the project's root
directory into scripts/. Also use re instead of fnmatch to find the
upgrade scriptlets.
|
|
|
|
|
|
|
| |
The upgrade scripts don't have a .py file extension. For this reason
they are not picked up by pylint in tox.ini. Tox doesn't support shell
scripting. In order to check all files I rewrote the
pylint-build-scan.sh script as Python script.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pki.handle_exceptions() raises a JSON decode exception when the body of
the HTTPException is not a valid JSON string. The JSON exception hides
the true error message.
The patch also fixes a bug in PKIException.from_json(). The code and
ClassName attribute are now correctly set. Finally we have our first
unit test.
https://fedorahosted.org/pki/ticket/1488
https://fedorahosted.org/freeipa/ticket/5129
|
|
Before the patch it wasn't possible to run pylint outside a RPM build.
The Python sources were split into common and server files in two
separate trees. With setup.py and tox the pki package can now be
installed and tested in a virtual env.
Tox enables developers to automate installation and testing in Python
virtual environment. The new tox.ini performs several tasks with one
command:
* It creates and installs a source distribution of pki packages and its
command line scripts
* It verifies that all CLI scripts can be execute (using its --help
argument).
* It runs pylint on all Python files and CLI scripts.
* It can run flake8 on all Python and CLI files (disabled for now).
* Finally it builds Sphinx autodocs.
I had to delay the root check in pkispawn and pkidestroy and modify two
files to get rid of Sphinx warnings.
https://fedorahosted.org/pki/ticket/696
http://tox.readthedocs.org
|