summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/service.py
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2008-03-27 19:01:38 -0400
committerSimo Sorce <ssorce@redhat.com>2008-03-27 19:01:38 -0400
commitaac086582aee79ccf72206faf118e997c623170c (patch)
tree7c806025ad651531015b62ca806db7a32f55c2a8 /ipa-server/ipaserver/service.py
parentb7924139d895c7ebe019fbfc9c85fed3baae642e (diff)
downloadfreeipa.git-aac086582aee79ccf72206faf118e997c623170c.tar.gz
freeipa.git-aac086582aee79ccf72206faf118e997c623170c.tar.xz
freeipa.git-aac086582aee79ccf72206faf118e997c623170c.zip
Move sysrestore to ipa-python so it can be used by client scripts too.
Change backup format so files are all in a single directory (no dir hierarchies) and use an index file so we can save also ownership and permission info for the restore (and eventually other data later on).
Diffstat (limited to 'ipa-server/ipaserver/service.py')
-rw-r--r--ipa-server/ipaserver/service.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/ipa-server/ipaserver/service.py b/ipa-server/ipaserver/service.py
index dbdc9a72..f9270f2e 100644
--- a/ipa-server/ipaserver/service.py
+++ b/ipa-server/ipaserver/service.py
@@ -18,7 +18,7 @@
#
import logging, sys
-import sysrestore
+from ipa import sysrestore
from ipa import ipautil
@@ -30,7 +30,7 @@ def start(service_name):
def restart(service_name):
ipautil.run(["/sbin/service", service_name, "restart"])
-
+
def is_running(service_name):
ret = True
try:
@@ -38,7 +38,7 @@ def is_running(service_name):
except ipautil.CalledProcessError:
ret = False
return ret
-
+
def chkconfig_on(service_name):
ipautil.run(["/sbin/chkconfig", service_name, "on"])
@@ -70,12 +70,12 @@ def is_enabled(service_name):
break
return (runlevels[3] and runlevels[4] and runlevels[5])
-
+
def print_msg(message, output_fd=sys.stdout):
logging.debug(message)
output_fd.write(message)
output_fd.write("\n")
-
+
class Service:
def __init__(self, service_name):
@@ -85,7 +85,7 @@ class Service:
def set_output(self, fd):
self.output_fd = fd
-
+
def stop(self):
stop(self.service_name)
@@ -133,7 +133,7 @@ class Service:
self.print_msg(" [%d/%d]: %s" % (step+1, len(self.steps), message))
method()
step += 1
-
+
self.print_msg("done configuring %s." % self.service_name)
self.steps = []