diff options
author | David Kupka <dkupka@redhat.com> | 2014-11-06 17:57:26 -0500 |
---|---|---|
committer | Petr Viktorin <pviktori@dhcp-31-13.brq.redhat.com> | 2014-11-11 09:18:30 +0100 |
commit | 82c3c2b242c3f2b8113c2021cf4d17cab54c2a86 (patch) | |
tree | cbef8c4d3c3a4df2bf1b14e4a8954a65ffb19fdc /ipaplatform | |
parent | d95d557ce5dc8c9c0a629af90bf7ae2224de0eb0 (diff) | |
download | freeipa-82c3c2b242c3f2b8113c2021cf4d17cab54c2a86.tar.gz freeipa-82c3c2b242c3f2b8113c2021cf4d17cab54c2a86.tar.xz freeipa-82c3c2b242c3f2b8113c2021cf4d17cab54c2a86.zip |
Remove unneeded internal methods. Move code to public methods.
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaplatform')
-rw-r--r-- | ipaplatform/base/services.py | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/ipaplatform/base/services.py b/ipaplatform/base/services.py index 961c368e6..01d95b39c 100644 --- a/ipaplatform/base/services.py +++ b/ipaplatform/base/services.py @@ -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,36 +448,22 @@ 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", + ipautil.run([paths.SYSTEMCTL, "mask", self.service_instance(instance_name)]) except ipautil.CalledProcessError: pass - def __mask(self, instance_name=""): + def unmask(self, instance_name=""): try: - ipautil.run([paths.SYSTEMCTL, "mask", + ipautil.run([paths.SYSTEMCTL, "unmask", self.service_instance(instance_name)]) except ipautil.CalledProcessError: pass - def __unmask(self, instance_name=""): + def __enable(self, instance_name=""): try: - ipautil.run([paths.SYSTEMCTL, "unmask", + ipautil.run([paths.SYSTEMCTL, "enable", self.service_instance(instance_name)]) except ipautil.CalledProcessError: pass |