From aad8c05727a04c5f608d1ec0ce46f5056007d245 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Dec 25 2016 19:58:10 +0000 Subject: fedora-cert: Fix username in kinit command example When running fedora-cert --configure-krb the code uses the username variable to write the ~/.fedora.upn file but uses opts.username in the output. The username may not have been explicitly passed as an option, in which case opts.username is False. The username is derived from an existing or newly generated certificate if not provided. This causes potentially misleading output for the suggested kinit command: [tmz@localhost ~]$ fedora-cert --configure-krb Kerberos username configured. Run kinit False@FEDORAPROJECT.ORG [tmz@localhost ~]$ cat ~/.fedora.upn tmz Signed-off-by: Todd Zullinger --- diff --git a/src/fedora-cert.py b/src/fedora-cert.py index 00b3839..19ed6d5 100755 --- a/src/fedora-cert.py +++ b/src/fedora-cert.py @@ -37,7 +37,7 @@ def main(opts): with open(os.path.expanduser('~/.fedora.upn'), 'w') as f: f.write(username) print('Kerberos username configured. Run kinit %s@FEDORAPROJECT.ORG' % - opts.username) + username) sys.exit(0) #has cert expired? do we force a new cert? get a new one