diff options
author | Karl MacMillan <kmacmill@redhat.com> | 2007-11-05 14:42:11 -0500 |
---|---|---|
committer | Karl MacMillan <kmacmill@redhat.com> | 2007-11-05 14:42:11 -0500 |
commit | 8e48393c61397e80f7d8d29d5b48d97988aa6c84 (patch) | |
tree | 06f0868a03db8d2554acf926a61e4d3555c029a2 /ipa-server/ipaserver/radiusinstance.py | |
parent | 957a70e560c2109d9cd788327fa18918294c29d7 (diff) | |
download | freeipa.git-8e48393c61397e80f7d8d29d5b48d97988aa6c84.tar.gz freeipa.git-8e48393c61397e80f7d8d29d5b48d97988aa6c84.tar.xz freeipa.git-8e48393c61397e80f7d8d29d5b48d97988aa6c84.zip |
Introduce service base class and clean up ipa-server-install
1) Add a base class for all of the instance objects.
2) Normalize usage of logging.
3) General cleanups of ipa-server-install.
4) Make better use of httpinstance.
5) Add webguiinstance.
6) Improve progress reporting during installation.
Works Here (TM), but it would be nice to get someone else
to test since this moves code around a bit.
Diffstat (limited to 'ipa-server/ipaserver/radiusinstance.py')
-rw-r--r-- | ipa-server/ipaserver/radiusinstance.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/ipa-server/ipaserver/radiusinstance.py b/ipa-server/ipaserver/radiusinstance.py index 8c7a929d..27e7527e 100644 --- a/ipa-server/ipaserver/radiusinstance.py +++ b/ipa-server/ipaserver/radiusinstance.py @@ -27,6 +27,8 @@ import pwd import time from ipa.ipautil import * +import service + import os import re @@ -47,8 +49,9 @@ from ipaserver.funcs import DefaultUserContainer, DefaultGroupContainer #------------------------------------------------------------------------------- -class RadiusInstance: +class RadiusInstance(service.Service): def __init__(self): + service.Service.__init__(self, "radiusd") self.fqdn = None self.realm = None self.principal = None @@ -66,6 +69,8 @@ class RadiusInstance: else: self.rpm_name = self.rpm_version = self.rpm_release = None + self.start_creation(4, "Configuring radiusd") + try: self.stop() except: @@ -76,22 +81,17 @@ class RadiusInstance: self.__radiusd_conf() try: + self.step("starting radiusd") self.start() except: logging.error("radiusd service failed to start") + self.step("configuring radiusd to start on boot") + self.chkconfig_on() - def stop(self): - run(['/sbin/service', 'radiusd', 'stop']) - - def start(self): - run(['/sbin/service', 'radiusd', 'start']) - - def restart(self): - run(['/sbin/service', 'radiusd', 'restart']) def __radiusd_conf(self): - logging.debug('configuring radiusd.conf for radius instance') + self.step('configuring radiusd.conf for radius instance') version = 'IPA_RADIUS_VERSION=%s RADIUS_PACKAGE_VERSION=%s' % (IPA_RADIUS_VERSION, self.rpm_nvr) sub_dict = {'CONFIG_FILE_VERSION_INFO' : version, @@ -110,6 +110,7 @@ class RadiusInstance: logging.error("could not create %s: %s", RADIUSD_CONF_FILEPATH, e) def __create_radius_keytab(self): + self.step("create radiusd keytab") try: if file_exists(IPA_KEYTAB_FILEPATH): os.remove(IPA_KEYTAB_FILEPATH) |