From e5c07508060bdafb315c25cd712ceb23508ab20a Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Mon, 23 Jan 2012 10:01:41 -0500 Subject: Add SSH service to platform-specific services. Add method for getting configuration directory path of a service, so that a different SSH configuration directory can be specified on different platforms. https://fedorahosted.org/freeipa/ticket/754 --- ipapython/platform/redhat.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'ipapython/platform/redhat.py') diff --git a/ipapython/platform/redhat.py b/ipapython/platform/redhat.py index d99a9174..aee8bcc3 100644 --- a/ipapython/platform/redhat.py +++ b/ipapython/platform/redhat.py @@ -82,6 +82,10 @@ class RedHatService(base.PlatformService): def remove(self, instance_name=""): ipautil.run(["/sbin/chkconfig", "--del", self.service_name]) +class RedHatSSHService(RedHatService): + def get_config_dir(self, instance_name=""): + return '/etc/ssh' + class RedHatAuthConfig(base.AuthConfig): """ AuthConfig class implements system-independent interface to configure @@ -109,16 +113,21 @@ class RedHatAuthConfig(base.AuthConfig): args = self.__build_args() ipautil.run(["/usr/sbin/authconfig"]+args) +def redhat_service(name): + if name == 'sshd': + return RedHatSSHService(name) + return RedHatService(name) + class RedHatServices(base.KnownServices): def __init__(self): services = dict() for s in base.wellknownservices: - services[s] = RedHatService(s) + services[s] = redhat_service(s) # Call base class constructor. This will lock services to read-only super(RedHatServices, self).__init__(services) authconfig = RedHatAuthConfig -service = RedHatService +service = redhat_service knownservices = RedHatServices() def restore_context(filepath): -- cgit