diff options
author | Mark McLoughlin <markmc@redhat.com> | 2007-12-13 09:31:28 +0000 |
---|---|---|
committer | Mark McLoughlin <markmc@redhat.com> | 2007-12-13 09:31:28 +0000 |
commit | 6976f92862c1dba3f7a25baa1893c41a67590b23 (patch) | |
tree | 4d9f2e1a526c586b4fa43d00b84aad5e348f742b /ipa-server/ipaserver/ntpinstance.py | |
parent | c049d2d8218dc5c560f9692397af91cac2559edd (diff) | |
download | freeipa.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/ntpinstance.py')
-rw-r--r-- | ipa-server/ipaserver/ntpinstance.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ipa-server/ipaserver/ntpinstance.py b/ipa-server/ipaserver/ntpinstance.py index 3872d93c..b321ec07 100644 --- a/ipa-server/ipaserver/ntpinstance.py +++ b/ipa-server/ipaserver/ntpinstance.py @@ -25,11 +25,8 @@ from ipa import ipautil class NTPInstance(service.Service): def __init__(self): service.Service.__init__(self, "ntpd") - - def create_instance(self): - self.start_creation(3, "Configuring ntpd") - self.step("writing configuration") + def __write_config(self): # The template sets the config to point towards ntp.pool.org, but # they request that software not point towards the default pool. # We use the OS variable to point it towards either the rhel @@ -54,11 +51,13 @@ class NTPInstance(service.Service): fd.write(ntp_conf) fd.close() + def create_instance(self): + self.step("writing configuration", self.__write_config) + # we might consider setting the date manually using ntpd -qg in case # the current time is very far off. - self.step("starting ntpd") - self.start() - - self.step("configuring ntpd to start on boot") - self.chkconfig_on() + self.step("starting ntpd", self.start) + self.step("configuring ntpd to start on boot", self.chkconfig_on) + + self.start_creation("Configuring ntpd") |