diff options
| author | Fraser Tweedale <ftweedal@redhat.com> | 2016-11-04 17:07:41 +1000 |
|---|---|---|
| committer | David Kupka <dkupka@redhat.com> | 2016-11-10 10:21:47 +0100 |
| commit | b0430b67dc90fddf1e35fde9a0cf2977a07d7cbd (patch) | |
| tree | cd46112919df62afcd8476ae8294894c7e4b762a | |
| parent | db116f73fe5fc199bb2e28103cf5e3e2a24eab4c (diff) | |
Remove __main__ code from ipalib.x509 and ipalib.pkcs10
This code was presumably once used for testing, but has been
subsumed by the actual test suite.
Part of: https://fedorahosted.org/freeipa/ticket/6398
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
| -rw-r--r-- | ipalib/pkcs10.py | 10 | ||||
| -rw-r--r-- | ipalib/x509.py | 15 |
2 files changed, 0 insertions, 25 deletions
diff --git a/ipalib/pkcs10.py b/ipalib/pkcs10.py index 7145c13d4..a99351929 100644 --- a/ipalib/pkcs10.py +++ b/ipalib/pkcs10.py @@ -20,7 +20,6 @@ from __future__ import print_function import binascii -import sys from cryptography.hazmat.backends import default_backend import cryptography.x509 @@ -55,12 +54,3 @@ def load_certificate_request(data): except binascii.Error as e: raise ValueError(e) return cryptography.x509.load_der_x509_csr(data, default_backend()) - - -if __name__ == '__main__': - # Read PEM request from stdin and print out its components - - csrlines = sys.stdin.readlines() - csr = ''.join(csrlines) - - print(load_certificate_request(csr)) diff --git a/ipalib/x509.py b/ipalib/x509.py index 7f7a89c31..e1c386705 100644 --- a/ipalib/x509.py +++ b/ipalib/x509.py @@ -35,7 +35,6 @@ from __future__ import print_function import binascii import datetime import ipaddress -import sys import base64 import re @@ -486,17 +485,3 @@ def format_datetime(t): if t.tzinfo is None: t = t.replace(tzinfo=UTC()) return unicode(t.strftime("%a %b %d %H:%M:%S %Y %Z")) - - -if __name__ == '__main__': - # this can be run with: - # python ipalib/x509.py < /etc/ipa/ca.crt - - # Read PEM cert from stdin and print out its components - - certlines = sys.stdin.readlines() - cert = ''.join(certlines) - - cert = load_certificate(cert) - - print(cert) |
