diff options
author | Abhijeet Kasurde <akasurde@redhat.com> | 2016-05-05 17:58:09 +0530 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-05-10 13:12:54 +0200 |
commit | 865935739a37bb7c098f8379871648e776e582f2 (patch) | |
tree | a975d66e179e068d3baae31bbd88a58e86800e07 /ipaserver/install/server | |
parent | 7d4d819b90f23cffbe437566818e29c394800b9e (diff) | |
download | freeipa-865935739a37bb7c098f8379871648e776e582f2.tar.gz freeipa-865935739a37bb7c098f8379871648e776e582f2.tar.xz freeipa-865935739a37bb7c098f8379871648e776e582f2.zip |
Replaced find_hostname with api.env.host
Fixes: https://fedorahosted.org/freeipa/ticket/5841
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaserver/install/server')
-rw-r--r-- | ipaserver/install/server/upgrade.py | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py index 4f3a2cb06..38fe2c3e8 100644 --- a/ipaserver/install/server/upgrade.py +++ b/ipaserver/install/server/upgrade.py @@ -94,23 +94,6 @@ def update_conf(sub_dict, filename, template_filename): fd.write(template) fd.close() -def find_hostname(): - """Find the hostname currently configured in ipa-rewrite.conf""" - filename=paths.HTTPD_IPA_REWRITE_CONF - - if not ipautil.file_exists(filename): - return None - - pattern = "^[\s#]*.*https:\/\/([A-Za-z0-9\.\-]*)\/.*" - p = re.compile(pattern) - for line in fileinput.input(filename): - if p.search(line): - fileinput.close() - return p.search(line).group(1) - fileinput.close() - - raise RuntimeError("Unable to determine the fully qualified hostname from %s" % filename) - def find_autoredirect(fqdn): """ When upgrading ipa-rewrite.conf we need to see if the automatic redirect @@ -1437,10 +1420,7 @@ def upgrade_configuration(): fstore = sysrestore.FileStore(paths.SYSRESTORE) - fqdn = find_hostname() - if fqdn is None: - # ipa-rewrite.conf doesn't exist, nothing to do - raise RuntimeError("ipa-rewrite.conf doesn't exists (is this server?)") + fqdn = api.env.host # Ok, we are an IPA server, do the additional tests ds_serverid = installutils.realm_to_serverid(api.env.realm) |