summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/httpinstance.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipa-server/ipaserver/httpinstance.py')
-rw-r--r--ipa-server/ipaserver/httpinstance.py18
1 files changed, 2 insertions, 16 deletions
diff --git a/ipa-server/ipaserver/httpinstance.py b/ipa-server/ipaserver/httpinstance.py
index 1799cca07..de0b3af82 100644
--- a/ipa-server/ipaserver/httpinstance.py
+++ b/ipa-server/ipaserver/httpinstance.py
@@ -29,6 +29,7 @@ import time
import service
import certs
import dsinstance
+import installutils
from ipa.ipautil import *
HTTPD_DIR = "/etc/httpd"
@@ -43,21 +44,6 @@ successfully change with the command:
Try updating the policycoreutils and selinux-policy packages.
"""
-def update_file(filename, orig, subst):
- if os.path.exists(filename):
- pattern = "%s" % re.escape(orig)
- p = re.compile(pattern)
- for line in fileinput.input(filename, inplace=1):
- if not p.search(line):
- sys.stdout.write(line)
- else:
- sys.stdout.write(p.sub(subst, line))
- fileinput.close()
- return 0
- else:
- print "File %s doesn't exist." % filename
- return 1
-
class HTTPInstance(service.Service):
def __init__(self):
service.Service.__init__(self, "httpd")
@@ -145,7 +131,7 @@ class HTTPInstance(service.Service):
def __set_mod_nss_port(self):
self.step("Setting mod_nss port to 443")
- if update_file(NSS_CONF, '8443', '443') != 0:
+ if installutils.update_file(NSS_CONF, '8443', '443') != 0:
print "Updating %s failed." % NSS_CONF
def __setup_ssl(self):