Get server hostname from jsonrpc_uri in ipa-certupdate

https://fedorahosted.org/freeipa/ticket/3259

Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Jan Cholasta 2014-09-18 11:15:49 +02:00 committed by Martin Kosek
parent 9ab402c495
commit 4e68046751

View File

@ -20,6 +20,7 @@
import os
import tempfile
import shutil
import urlparse
from ipapython import (admintool, ipautil, ipaldap, sysrestore, dogtag,
certmonger, certdb)
@ -50,10 +51,7 @@ class CertUpdate(admintool.AdminTool):
api.bootstrap(context='cli_installer')
api.finalize()
try:
server = api.env.server
except AttributeError:
server = api.env.host
server = urlparse.urlsplit(api.env.jsonrpc_uri).hostname
ldap = ipaldap.IPAdmin(server)
tmpdir = tempfile.mkdtemp(prefix="tmp-")