summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/httpinstance.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2007-12-13 09:31:28 +0000
committerMark McLoughlin <markmc@redhat.com>2007-12-13 09:31:28 +0000
commit6976f92862c1dba3f7a25baa1893c41a67590b23 (patch)
tree4d9f2e1a526c586b4fa43d00b84aad5e348f742b /ipa-server/ipaserver/httpinstance.py
parentc049d2d8218dc5c560f9692397af91cac2559edd (diff)
downloadfreeipa.git-6976f92862c1dba3f7a25baa1893c41a67590b23.tar.gz
freeipa.git-6976f92862c1dba3f7a25baa1893c41a67590b23.tar.xz
freeipa.git-6976f92862c1dba3f7a25baa1893c41a67590b23.zip
Refactor krbinstance and dsinstance creation steps
Creation steps are currently done with: self.start_creation(2, "Create foo") self.step("do foo") self.foo() self.step("do bar") self.bar() self.done_creation() This patch refactors that into the much more straightforward: self.step("do foo", self.foo) self.step("do bar", self.bar) self.start_creation("Create foo") Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Diffstat (limited to 'ipa-server/ipaserver/httpinstance.py')
-rw-r--r--ipa-server/ipaserver/httpinstance.py33
1 files changed, 11 insertions, 22 deletions
diff --git a/ipa-server/ipaserver/httpinstance.py b/ipa-server/ipaserver/httpinstance.py
index 8a7c527a..d0329cca 100644
--- a/ipa-server/ipaserver/httpinstance.py
+++ b/ipa-server/ipaserver/httpinstance.py
@@ -57,25 +57,19 @@ class HTTPInstance(service.Service):
self.domain = fqdn[fqdn.find(".")+1:]
self.sub_dict = { "REALM" : realm, "FQDN": fqdn, "DOMAIN" : self.domain }
- self.start_creation(7, "Configuring the web interface")
-
- self.__disable_mod_ssl()
- self.__set_mod_nss_port()
- self.__configure_http()
- self.__create_http_keytab()
- self.__setup_ssl()
- self.__setup_autoconfig()
-
- self.step("restarting httpd")
- self.restart()
-
- self.step("configuring httpd to start on boot")
- self.chkconfig_on()
-
- self.done_creation()
+ self.step("disabling mod_ssl in httpd", self.__disable_mod_ssl)
+ self.step("Setting mod_nss port to 443", self.__set_mod_nss_port)
+ self.step("configuring httpd", self.__configure_http)
+ self.step("creating a keytab for httpd", self.__create_http_keytab)
+ self.step("Setting up ssl", self.__setup_ssl)
+ self.step("Setting up browser autoconfig", self.__setup_autoconfig)
+ self.step("configuring SELinux for httpd", self.__selinux_config)
+ self.step("restarting httpd", self.restart)
+ self.step("configuring httpd to start on boot", self.chkconfig_on)
+
+ self.start_creation("Configuring the web interface")
def __selinux_config(self):
- self.step("configuring SELinux for httpd")
selinux=0
try:
if (os.path.exists('/usr/sbin/selinuxenabled')):
@@ -94,7 +88,6 @@ class HTTPInstance(service.Service):
self.print_msg(selinux_warning)
def __create_http_keytab(self):
- self.step("creating a keytab for httpd")
try:
if ipautil.file_exists("/etc/httpd/conf/ipa.keytab"):
os.remove("/etc/httpd/conf/ipa.keytab")
@@ -122,7 +115,6 @@ class HTTPInstance(service.Service):
os.chown("/etc/httpd/conf/ipa.keytab", pent.pw_uid, pent.pw_gid)
def __configure_http(self):
- self.step("configuring httpd")
http_txt = ipautil.template_file(ipautil.SHARE_DIR + "ipa.conf", self.sub_dict)
http_fd = open("/etc/httpd/conf.d/ipa.conf", "w")
http_fd.write(http_txt)
@@ -130,17 +122,14 @@ class HTTPInstance(service.Service):
def __disable_mod_ssl(self):
- self.step("disabling mod_ssl in httpd")
if os.path.exists(SSL_CONF):
os.rename(SSL_CONF, "%s.moved_by_ipa" % SSL_CONF)
def __set_mod_nss_port(self):
- self.step("Setting mod_nss port to 443")
if installutils.update_file(NSS_CONF, '8443', '443') != 0:
print "Updating %s failed." % NSS_CONF
def __setup_ssl(self):
- self.step("Setting up ssl")
ds_ca = certs.CertDB(dsinstance.config_dirname(self.realm))
ca = certs.CertDB(NSS_DIR)
ds_ca.cur_serial = 2000