summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-09-25 14:58:27 +0200
committerGuido Günther <agx@sigxcpu.org>2010-09-25 14:58:27 +0200
commit62e967452e02d81abfb06c30272145b88ba6d42f (patch)
tree2291d8bec356a2ae43163a3e0b651f17e342e3b8
parented0860e574333a1304118b6e6306108168104286 (diff)
Implement service restart for RedHat based distros
-rwxr-xr-xwhatmaps10
1 files changed, 5 insertions, 5 deletions
diff --git a/whatmaps b/whatmaps
index 81022f9..508f071 100755
--- a/whatmaps
+++ b/whatmaps
@@ -107,7 +107,7 @@ class Distro(object):
@classmethod
def restart_service(klass, service):
"""Restart a service"""
- raise NotImplementedError
+ subprocess.call(klass.restart_service_cmd(service))
@classmethod
def pkg_services(klass, pkg):
@@ -203,10 +203,6 @@ class DebianDistro(Distro):
return ['invoke-rc.d', name, 'restart']
@classmethod
- def restart_service(klass, name):
- subprocess.call(klass.restart_service_cmd(name))
-
- @classmethod
def has_apt(klass):
return True
@@ -347,6 +343,10 @@ class RedHatDistro(Distro):
pkg = output.strip()
return RpmPkg(pkg)
+ @classmethod
+ def restart_service_cmd(klass, name):
+ return ['service', name, 'restart']
+
class FedoraDistro(RedHatDistro):
id = 'Fedora'