mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Remove unneeded internal methods. Move code to public methods.
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
d95d557ce5
commit
82c3c2b242
@ -436,7 +436,11 @@ class SystemdService(PlatformService):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
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=""):
|
def mask(self, instance_name=""):
|
||||||
if instance_name != "":
|
if instance_name != "":
|
||||||
@ -444,40 +448,26 @@ class SystemdService(PlatformService):
|
|||||||
# remove instance file or link before masking
|
# remove instance file or link before masking
|
||||||
if os.path.islink(srv_tgt):
|
if os.path.islink(srv_tgt):
|
||||||
os.unlink(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:
|
try:
|
||||||
ipautil.run([paths.SYSTEMCTL, "mask",
|
ipautil.run([paths.SYSTEMCTL, "mask",
|
||||||
self.service_instance(instance_name)])
|
self.service_instance(instance_name)])
|
||||||
except ipautil.CalledProcessError:
|
except ipautil.CalledProcessError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def __unmask(self, instance_name=""):
|
def unmask(self, instance_name=""):
|
||||||
try:
|
try:
|
||||||
ipautil.run([paths.SYSTEMCTL, "unmask",
|
ipautil.run([paths.SYSTEMCTL, "unmask",
|
||||||
self.service_instance(instance_name)])
|
self.service_instance(instance_name)])
|
||||||
except ipautil.CalledProcessError:
|
except ipautil.CalledProcessError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def __enable(self, instance_name=""):
|
||||||
|
try:
|
||||||
|
ipautil.run([paths.SYSTEMCTL, "enable",
|
||||||
|
self.service_instance(instance_name)])
|
||||||
|
except ipautil.CalledProcessError:
|
||||||
|
pass
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
self.enable()
|
self.enable()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user