From 62e967452e02d81abfb06c30272145b88ba6d42f Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 25 Sep 2010 14:58:27 +0200 Subject: Implement service restart for RedHat based distros --- whatmaps | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'whatmaps') 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): @@ -202,10 +202,6 @@ class DebianDistro(Distro): def restart_service_cmd(klass, name): 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' -- cgit v1.2.3