Remove unneeded internal methods. Move code to public methods.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
David Kupka 2014-11-06 17:57:26 -05:00 committed by Petr Viktorin
parent d95d557ce5
commit 82c3c2b242

View File

@ -436,7 +436,11 @@ class SystemdService(PlatformService):
except:
pass
else:
self.__disable(instance_name)
try:
ipautil.run([paths.SYSTEMCTL, "disable",
self.service_instance(instance_name)])
except ipautil.CalledProcessError:
pass
def mask(self, instance_name=""):
if instance_name != "":
@ -444,40 +448,26 @@ class SystemdService(PlatformService):
# remove instance file or link before masking
if os.path.islink(srv_tgt):
os.unlink(srv_tgt)
self.__mask(instance_name)
def unmask(self, instance_name=""):
self.__unmask(instance_name)
def __enable(self, instance_name=""):
try:
ipautil.run([paths.SYSTEMCTL, "enable",
self.service_instance(instance_name)])
except ipautil.CalledProcessError:
pass
def __disable(self, instance_name=""):
try:
ipautil.run([paths.SYSTEMCTL, "disable",
self.service_instance(instance_name)])
except ipautil.CalledProcessError:
pass
def __mask(self, instance_name=""):
try:
ipautil.run([paths.SYSTEMCTL, "mask",
self.service_instance(instance_name)])
except ipautil.CalledProcessError:
pass
def __unmask(self, instance_name=""):
def unmask(self, instance_name=""):
try:
ipautil.run([paths.SYSTEMCTL, "unmask",
self.service_instance(instance_name)])
except ipautil.CalledProcessError:
pass
def __enable(self, instance_name=""):
try:
ipautil.run([paths.SYSTEMCTL, "enable",
self.service_instance(instance_name)])
except ipautil.CalledProcessError:
pass
def install(self):
self.enable()