summaryrefslogtreecommitdiffstats
path: root/base/common/python/pki/upgrade.py
Commit message (Collapse)AuthorAgeFilesLines
* Re-license the python client files to LGPLv3Ade Lee2016-07-291-6/+7
|
* Remove #!python shebang from non-executablesChristian Heimes2016-01-191-1/+0
| | | | | | | | | A lot of Python files start with a #!/usr/bin/python shebang although the files are neither executables nor designed as scripts. Shebangs are only required for executable scripts. Without unnecessary shebangs it's a bit easier to track Python 3 porting.
* Py3 compatibility: __eq__ blocks inheritance of __hash__Christian Heimes2015-08-171-0/+6
| | | | | | | | Some types implement __eq__ but don't provide a __hash__ function. Mark these types as non-hashable with __hash__ = None. This fixes: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x
* Py3 modernization: misc manual fixesChristian Heimes2015-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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.
* Py3 modernization: lib2to3.fixes.fix_execfileChristian Heimes2015-08-171-1/+4
| | | | | execfile has been removed from Python 3. The upgrade importer now reads, compiles and executed the upgrade scripts manually.
* Py3 modernization: libmodernize.fixes.fix_printChristian Heimes2015-08-171-38/+39
| | | | | | | | | Replace print statement with Python 3's print() function. For Python 2 'from __future__ import print_function' turns the print statement into Python 3 compatible print function. See https://www.python.org/dev/peps/pep-3105/
* 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-5/+7
| | | | | | | | | | | | | | | | | | | 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
* Replace Exception.message with str(exc)Christian Heimes2015-08-101-5/+5
| | | | | | | | | | | | | | | Python 3 has deprecated and remove Exception.message. Instead we should simply use string formatting to print the message of an Exception. >>> import pki >>> pki.PKIException('msg') PKIException('msg',) >>> pki.PKIException('msg').message 'msg' >>> str(pki.PKIException('msg')) 'msg' >>> '%s' % pki.PKIException('msg') 'msg'
* 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 pylint failure on F21.Endi S. Dewata2014-10-271-2/+2
| | | | | The build failed on F21 due to stricter pylint requirements which generate new warnings. For now they are marked to be ignored.
* formatting fixes in python client code for pycharmAde Lee2014-05-291-55/+78
|
* Added decorator to handle exceptionsAde Lee2014-02-191-5/+5
| | | | | | Decorator catches HttpErrorExceptions from Requests and extracts the relevant PKIException object, and rethrows it.
* Backup upgrade tracker.Endi S. Dewata2013-10-311-2/+6
| | | | | | | | | The upgrade framework has been modified to backup the files used to track the upgrade progress. If the tracker file is also modified by the upgrade scriptlet, it will only keep the initial backup (before any modifications were made). Ticket #763
* Fix issues reported by pylint.Abhishek Koneru2013-07-101-1/+1
| | | | | | | Fixed all warnings caused due to absolute import of modules in same package and not marking the regexes with an r when trying to match. Ticket #316
* Added support to backup folders during upgrade.Endi Sukma Dewata2013-07-081-22/+72
| | | | | | | The upgrade framework has been updated to support backup and restore operations for folders and their contents. Ticket #583
* Fixes for issues reported by pylint.Abhishek Koneru2013-07-021-18/+17
| | | | | Fixes for issues in other files. Ticket #316
* Applied PEP8 formatting to python files.Abhishek Koneru2013-06-271-9/+9
| | | | | | | General formatting done for all the python files except for the line length issue, which could not be formatted using Pydev in Eclipse. Ticket #316
* Added support for backup/restore on upgrade.Endi Sukma Dewata2013-05-151-18/+164
| | | | | | | | | | The upgrade framework has been modified to support backup and restore functionality. A new method backup(filename) has been added to save a file into a backup folder. The CLI's have been modified to accept a --revert parameter which will restore the backup files one version at a time. Ticket #583
* Restored /etc/pki/pki.conf.Endi Sukma Dewata2013-04-301-3/+4
| | | | | | The /etc/pki/pki.conf has been restored. The RPM spec file has been modified such that it will create system upgrade tracker file (/etc/pki/pki.version) on install and remove it on uninstall.
* Added upgrade scriptlet to add JNI_JAR_DIR.Endi Sukma Dewata2013-04-291-103/+62
| | | | | | | | | | A new upgrade scriptlet has been added to add JNI_JAR_DIR into pki.conf. The code to manipulate property files has been refactored from PKIUpgradeTracker into a separate PropertyFile class to allow reuse. The pki-base package has been modified to deliver a default pki.conf in /usr/share/pki/etc and copy it into /etc/pki if it doesn't exist.
* Refactored upgrade framework into base and server upgrade.Endi Sukma Dewata2013-04-251-307/+44
| | | | | | | | | | The upgrade framework has been split into base and server upgrade frameworks since they will be run automatically by different RPM packages during upgrade. The base upgrade framework will upgrade the system configuration. The server upgrade framework will upgrade the instances and subsystems. Ticket #544
* Added servlet to return 501 for rest operations for d9 instancesAde Lee2013-04-221-82/+78
| | | | | | | | | | D9 instances run on tomcat6, which does not have support for the autheticator and realm. We are not supporting the REST operations on D9 style instances. They will need to be migrated. The migration framework has been modified to process d9 or d10 style instances, and a migration script has been added to add the new servlet to existing d9 instances.
* Tracking upgrade using existing config files.Endi Sukma Dewata2013-04-171-29/+48
| | | | | | | | | | | The upgrade framework has been modified to use pki.conf to track system upgrade, tomcat.conf to track instance upgrade, and CS.cfg to track subsystem upgrade. The preop.product.version in CS.cfg has been renamed into cms.product.version and is now used to track upgrade. Ticket #544
* Refactored pki.upgrade module.Endi Sukma Dewata2013-04-171-117/+87
| | | | | | | Some common constants and methods in pki.upgrade have been moved into the pki module. Ticket #544
* Added upgrade framework.Endi Sukma Dewata2013-04-091-0/+860
A new Python library has been added to provide a framework to develop upgrade scriptlets. A new CLI has been added to execute the upgrade scriptlets. Ticket #544