| |
@@ -29,6 +29,8 @@
|
| |
Read in the certificate so we dont duplicate the code
|
| |
"""
|
| |
# Make sure we can even read the thing.
|
| |
+ if os.path.exists(os.path.expanduser('~/.fedora.upn')):
|
| |
+ return None
|
| |
cert_file = os.path.join(os.path.expanduser('~'), ".fedora.cert")
|
| |
if not os.access(cert_file, os.R_OK):
|
| |
raise fedora_cert_error("""!!! cannot read your ~/.fedora.cert file !!!
|
| |
@@ -44,6 +46,10 @@
|
| |
not revoked
|
| |
Expiry time warn if less than 21 days
|
| |
"""
|
| |
+ if os.path.exists(os.path.expanduser('~/.fedora.upn')):
|
| |
+ print('Kerberos configured, cert ignored')
|
| |
+ return
|
| |
+
|
| |
my_cert = _open_cert()
|
| |
valid_until = my_cert.get_notAfter()[:8].decode()
|
| |
|
| |
@@ -84,6 +90,10 @@
|
| |
Figure out the Fedora user name from ~/.fedora.cert
|
| |
|
| |
"""
|
| |
+ if os.path.exists(os.path.expanduser('~/.fedora.upn')):
|
| |
+ with file(os.path.expanduser('~/.fedora.upn'), 'r') as f:
|
| |
+ return f.read().replace('\n', '')
|
| |
+
|
| |
my_cert = _open_cert()
|
| |
|
| |
subject = str(my_cert.get_subject())
|
| |
Signed-off-by: Patrick Uiterwijk puiterwijk@redhat.com