summaryrefslogtreecommitdiffstats
path: root/func/certs.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-01-29 17:08:45 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-01-29 17:08:45 -0500
commitcd30007bc66ab5b0512e94c94c84de5e95e8e3ad (patch)
tree68d2f792cfb7c3e6410019116209578e45dd5b33 /func/certs.py
parent6c47e982fa3089f86ce96742b0673dc320ac208e (diff)
downloadthird_party-func-cd30007bc66ab5b0512e94c94c84de5e95e8e3ad.tar.gz
third_party-func-cd30007bc66ab5b0512e94c94c84de5e95e8e3ad.tar.xz
third_party-func-cd30007bc66ab5b0512e94c94c84de5e95e8e3ad.zip
Applying a variant on Brenton's patch for DNS issues.
Diffstat (limited to 'func/certs.py')
-rw-r--r--func/certs.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/func/certs.py b/func/certs.py
index 22af866..810d17c 100644
--- a/func/certs.py
+++ b/func/certs.py
@@ -48,7 +48,12 @@ def make_csr(pkey, dest=None, cn=None):
if cn:
subj.CN = cn
else:
- subj.CN = socket.getfqdn()
+ fqdn = socket.getfqdn()
+ host = socket.gethostname()
+ if fdqn.find(host) != -1:
+ subj.CN = fqdn
+ else:
+ subj.CN = host
subj.emailAddress = 'root@%s' % subj.CN
req.set_pubkey(pkey)