From 04ba21aaca9c376abab36cf75d764507a3b14802 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Mon, 10 Oct 2011 15:25:15 +0300 Subject: Add support for systemd environments and use it to support Fedora 16 https://fedorahosted.org/freeipa/ticket/1192 --- ipapython/platform/redhat.py | 61 +++++++++----------------------------------- 1 file changed, 12 insertions(+), 49 deletions(-) (limited to 'ipapython/platform/redhat.py') diff --git a/ipapython/platform/redhat.py b/ipapython/platform/redhat.py index 6bf8bf348..d9de3abca 100644 --- a/ipapython/platform/redhat.py +++ b/ipapython/platform/redhat.py @@ -65,20 +65,20 @@ class RedHatService(base.PlatformService): installed = False return installed - def is_enabled(self): + def is_enabled(self, instance_name=""): (stdout, stderr, returncode) = ipautil.run(["/sbin/chkconfig", self.service_name],raiseonerr=False) return (returncode == 0) - def enable(self): + def enable(self, instance_name=""): ipautil.run(["/sbin/chkconfig", self.service_name, "on"]) - def disable(self): + def disable(self, instance_name=""): ipautil.run(["/sbin/chkconfig", self.service_name, "off"]) - def install(self): + def install(self, instance_name=""): ipautil.run(["/sbin/chkconfig", "--add", self.service_name]) - def remove(self): + def remove(self, instance_name=""): ipautil.run(["/sbin/chkconfig", "--del", self.service_name]) class RedHatAuthConfig(base.AuthConfig): @@ -133,48 +133,11 @@ def restore_context(filepath): ipautil.run(["/sbin/restorecon", filepath], raiseonerr=False) def backup_and_replace_hostname(fstore, statestore, hostname): - network_filename = "/etc/sysconfig/network" - # Backup original /etc/sysconfig/network - fstore.backup_file(network_filename) - hostname_pattern = re.compile(''' -(^ - \s* - (?P