From 4dc46e90618aa84ca851c210583dc5796d387cc6 Mon Sep 17 00:00:00 2001 From: MorrisA Date: Sat, 5 Apr 2014 18:10:45 -0700 Subject: [PATCH] Modified Cron to add AIX Crontab support, changed according to suggestions from mpdehaan and redone entirely. --- library/system/cron | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/system/cron b/library/system/cron index 9fc9a1a11f1..a85bdd57976 100644 --- a/library/system/cron +++ b/library/system/cron @@ -352,6 +352,8 @@ class CronTab(object): if self.user: if platform.system() == 'SunOS': return "su %s -c '%s -l'" % (pipes.quote(self.user), pipes.quote(CRONCMD)) + elif platform.system() == 'AIX': + return "%s -l %s" % (pipes.quote(CRONCMD), (pipes.quote(self.user)) else: user = '-u %s' % pipes.quote(self.user) return "%s %s %s" % (CRONCMD , user, '-l') @@ -362,7 +364,7 @@ class CronTab(object): """ user = '' if self.user: - if platform.system() == 'SunOS': + if platform.system() in [ 'SunOS', 'AIX' ]: return "chown %s %s ; su '%s' -c '%s %s'" % (pipes.quote(self.user), pipes.quote(path), pipes.quote(self.user), CRONCMD, pipes.quote(path)) else: user = '-u %s' % pipes.quote(self.user)