diff options
author | Seth Vidal <skvidal@fedoraproject.org> | 2008-02-05 16:25:16 -0500 |
---|---|---|
committer | Seth Vidal <skvidal@fedoraproject.org> | 2008-02-05 16:25:16 -0500 |
commit | a9ecad95e33506b21c7b1a282b5c2fd4bfb693cf (patch) | |
tree | 28da6265ee34333f886ad2efe61d8000cd09db7e /func/certs.py | |
parent | 6b9881532773f8e697437d8c6b92ce99477a0a43 (diff) | |
parent | 40ccbbf55e6fedf57629ba344dfee2e0b3ceda18 (diff) | |
download | third_party-func-a9ecad95e33506b21c7b1a282b5c2fd4bfb693cf.tar.gz third_party-func-a9ecad95e33506b21c7b1a282b5c2fd4bfb693cf.tar.xz third_party-func-a9ecad95e33506b21c7b1a282b5c2fd4bfb693cf.zip |
Merge branch 'master' of ssh://git.fedorahosted.org/git/hosted/func
* 'master' of ssh://git.fedorahosted.org/git/hosted/func:
Make hostname detection code shared.
seeing if this resultis 0 is dumb, just see if it executes
use socket.getfqdn instead of gethostname for sanity sake
Adding a module to allow func to control certmaster via func, this will be more useful once we have support for local connections.
Diffstat (limited to 'func/certs.py')
-rw-r--r-- | func/certs.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/func/certs.py b/func/certs.py index 413f9ce..4d6bf15 100644 --- a/func/certs.py +++ b/func/certs.py @@ -17,6 +17,7 @@ from OpenSSL import crypto import socket import os +import utils def_country = 'UN' def_state = 'FC' @@ -48,12 +49,7 @@ def make_csr(pkey, dest=None, cn=None): if cn: subj.CN = cn else: - fqdn = socket.getfqdn() - host = socket.gethostname() - if fqdn.find(host) != -1: - subj.CN = fqdn - else: - subj.CN = host + subj.CN = utils.get_hostname() subj.emailAddress = 'root@%s' % subj.CN req.set_pubkey(pkey) |