summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2011-05-10 15:14:20 +0200
committerMartin Kosek <mkosek@redhat.com>2011-05-13 13:24:35 +0200
commit2cbc6fd6a2c33b46f97658b613bfca9182a5b518 (patch)
treedf9fa64a72af04f5283f3e5218373a41b85ef9f2 /ipaserver
parent72b56e4630f99608808522b2b5f768497f94d2bd (diff)
downloadfreeipa-2cbc6fd6a2c33b46f97658b613bfca9182a5b518.zip
freeipa-2cbc6fd6a2c33b46f97658b613bfca9182a5b518.tar.gz
freeipa-2cbc6fd6a2c33b46f97658b613bfca9182a5b518.tar.xz
Improve service manipulation in client install
Remove redundant ipa-client-install error message when optional nscd daemon was not installed. Additionally, use standard IPA functions for service manipulation and improve logging. https://fedorahosted.org/freeipa/ticket/1207
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/service.py30
1 files changed, 12 insertions, 18 deletions
diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py
index 0d31927..d8d04e7 100644
--- a/ipaserver/install/service.py
+++ b/ipaserver/install/service.py
@@ -41,40 +41,34 @@ SERVICE_LIST = {
}
def stop(service_name, instance_name="", capture_output=True):
- ipautil.run(["/sbin/service", service_name, "stop", instance_name],
- capture_output=capture_output)
+ ipautil.service_stop(service_name, instance_name, capture_output)
def start(service_name, instance_name="", capture_output=True):
- ipautil.run(["/sbin/service", service_name, "start", instance_name],
- capture_output=capture_output)
+ ipautil.service_start(service_name, instance_name, capture_output)
def restart(service_name, instance_name="", capture_output=True):
- ipautil.run(["/sbin/service", service_name, "restart", instance_name],
- capture_output=capture_output)
+ ipautil.service_restart(service_name, instance_name, capture_output)
def is_running(service_name, instance_name=""):
- ret = True
- try:
- ipautil.run(["/sbin/service", service_name, "status", instance_name])
- except ipautil.CalledProcessError:
- ret = False
- return ret
+ return ipautil.service_is_running(service_name, instance_name)
+
+def is_installed(service_name):
+ return ipautil.service_is_installed(service_name)
def chkconfig_on(service_name):
- ipautil.run(["/sbin/chkconfig", service_name, "on"])
+ ipautil.chkconfig_on(service_name)
def chkconfig_off(service_name):
- ipautil.run(["/sbin/chkconfig", service_name, "off"])
+ ipautil.chkconfig_on(service_name)
def chkconfig_add(service_name):
- ipautil.run(["/sbin/chkconfig", "--add", service_name])
+ ipautil.chkconfig_on(service_name)
def chkconfig_del(service_name):
- ipautil.run(["/sbin/chkconfig", "--del", service_name])
+ ipautil.chkconfig_on(service_name)
def is_enabled(service_name):
- (stdout, stderr, returncode) = ipautil.run(["/sbin/chkconfig", service_name], raiseonerr=False)
- return (returncode == 0)
+ return ipautil.service_is_enabled(service_name)
def print_msg(message, output_fd=sys.stdout):
logging.debug(message)