summaryrefslogtreecommitdiffstats
path: root/base/common/python/pki/encoder.py
Commit message (Collapse)AuthorAgeFilesLines
* Replace legacy Python base64 invocations with Py3-safe codeChristian Heimes2015-10-011-0/+30
| | | | | | | | | Replace deprecated decodestring() and encodestring() with b64decode() and b64encode(). Provice specialized encode_cert() / decode_cert() functions to handle base64 encoding and decoding for X.509 certs in JSON strings. In Python 3 the base64 function don't suppor ASCII text, just ASCII bytes.
* Py3 modernization: libmodernize.fixes.fix_dict_sixChristian Heimes2015-08-171-5/+7
| | | | | | | | | In Python 3 dict methods like values(), items() and keys() return views rather than lists. The iter equivalents are gone. Use six to use iterators on Python 2 and 3. In some places like setup.py a list is required. Use list(somedict.values()) to get a list on all Python versions.
* Py3 modernization: libmodernize.fixes.fix_importChristian Heimes2015-08-171-0/+1
| | | | | | | | | | | | | | 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/
* Make pki PEP 8 compatibleChristian Heimes2015-08-141-1/+2
| | | | | | | | | | | | | | | | | | | 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
* Use dict.iteritems() instead of dict.items()Christian Heimes2015-08-101-2/+2
| | | | | | iteritems() is the preferred way to iterate over key, value pairs. Python-modernize can convert iteritems() to efficient code on Python 2 and 3.
* PKI TRAC Ticket #1388 - pylint unidiomatic-typecheck warnings cause koji ↵Matthew Harmsen2015-05-261-2/+3
| | | | | | builds to fail (cherry picked from commit d2c24aff4e9dc6aa27b337479cfee1fac4940994)
* Fixed pylint report.Endi S. Dewata2015-02-051-2/+2
| | | | | | | | | | | | | | | Previously pylint report was saved it into a file which may not be accessible on a build system. The pylint-build-scan.sh has been changed to display the report so it will appear in the build log. The pylint configuration has also been modified to disable C and R messages by default. This way when other errors or warnings occur the build will fail without having to check for specific codes. Some Python codes have been modified to reduce the number of pylint warnings. https://fedorahosted.org/pki/ticket/703
* Fixed incorrect Python API docs format.Endi S. Dewata2014-10-281-16/+18
| | | | | | | The Python API docs in some classes/methods have been fixed to remove the errors and warnings generated by python-sphinx. https://fedorahosted.org/pki/ticket/1157
* Refactoring ProfileClient to remove the property fields.Abhishek Koneru2014-07-111-9/+11
| | | | | | | | | | | | | Replaced the usage of python property feature with a dict for attribute name conversion. Fixed an issue caused to traversing the NOTYPES dict in encoder.py to find the instance of an object. The traversal causes an issue in the presence of subclassing. Modified method attr_name_conversion to return a new dictionary with modified attribute names rather than making changes to the object's __dict__.
* Fixes for #1040 and #1041 in cert and key python modulesAbhishek Koneru2014-06-271-1/+12
| | | | | | | | | | Ticket 1040 - Perform null checks on JSON attributes. Ticket 1041 - Rename module kraclient to kra. Also refactored the code in cert module removing the usage of property. Achieved the conversion of names(camelCase to '_' separated ) using a dictionaries in the objects. The default method in encoder module has also been modified to perform the reverse conversion.
* formatting fixes in python client code for pycharmAde Lee2014-05-291-8/+9
|
* Fixes for issues reported by pylint.Abhishek Koneru2013-07-181-0/+17
| | | | | | Fixed the warning W0202 - attributes defined outside init and error E0202 - An instance attribute hiding a method (which is actually an error in json.encoder.JSONEncoder line 157.)
* Fixes for issues reported by pylint.Abhishek Koneru2013-07-031-1/+0
| | | | | Fixes for issues in other files. Ticket #316
* Fixes for issues reported by pylint.Abhishek Koneru2013-07-021-1/+1
| | | | | Fixes for issues in other files. Ticket #316
* Refactor installation code to remove dependency on jythonAde Lee2013-03-211-0/+31
Connection is now made to the installation servlet through a python client using JSON. The code to construct the ConfgurationRequest and parse the results has been moved to pkihelper.py, and configuration.py no longer calls a separate jython process to create the Configuration object and parse the results. The jython code has therefore been removed. Also added status servlet to other java subsystems, to be tested prior to starting configuration. Trac Ticket 532