From 935633c5ea9f2b5c4321d924af166367008ac4b3 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Wed, 24 Feb 2016 22:22:10 +0100 Subject: Added Python wrapper for pki pkcs12-import. A Python wrapper module has been added for the pki pkcs12-import command to provide a mechanism to implement a workaround for JSS import limitation. Additional fixes by cheimes have been merged into this patch: setup.py: We must track all sub-packages manually. pylint-build-scan.py: pylint confuses the 'pki' package with the 'pki' command. The workaround symlinks the command and analysis the command under its alternative name. https://fedorahosted.org/pki/ticket/1742 --- scripts/pylint-build-scan.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/pylint-build-scan.py b/scripts/pylint-build-scan.py index e0db8fcb3..d4156e87b 100755 --- a/scripts/pylint-build-scan.py +++ b/scripts/pylint-build-scan.py @@ -38,7 +38,7 @@ PYLINTRC = os.path.join(SCRIPTPATH, 'dogtag.pylintrc') FILENAMES = [ os.path.abspath(__file__), '{sitepackages}/pki', - '{bin}/pki', + '{bin}/pki-cmd', # see HACK '{sbin}/pkispawn', '{sbin}/pkidestroy', '{sbin}/pki-upgrade', @@ -130,7 +130,17 @@ def main(): if args.verbose: pprint.pprint(pylint) - return subprocess.call(pylint, cwd=env['sitepackages']) + # HACK: + # pylint confuses the pki command with the pki package. We create a + # symlink from bin/pki to bin/pki-cmd and test bin/pki-cmd instead. + pki_bin = '{bin}/pki'.format(**env) + pki_cmd = '{bin}/pki-cmd'.format(**env) + os.symlink(pki_bin, pki_cmd) + + try: + return subprocess.call(pylint, cwd=env['sitepackages']) + finally: + os.unlink(pki_cmd) if __name__ == '__main__': sys.exit(main()) -- cgit