pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/50567: sysutils/salt: Fix cron module for SmartOS, Solaris, AIX



>Number:         50567
>Category:       pkg
>Synopsis:       sysutils/salt: Fix cron module for SmartOS, Solaris, AIX
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 17 01:45:00 +0000 2015
>Originator:     Travis Paul
>Release:        trunk
>Organization:
>Environment:
SunOS nessie 5.11 joyent_20151126T062747Z i86pc i386 i86pc
>Description:
The cron module in salt does not work completely with SmartOS, and likely Solaris and AIX.

This patch only makes the cron module functional for the user that is running salt, but in my case, and I assume others using these operating systems, that is better than the module not working at all. A better long-term fix may be need to be found.

There is an unmerged pull request here: https://github.com/saltstack/salt/pull/29777
>How-To-Repeat:
Attempt to use the cron salt module to add new entries to the crontab it will fail with:

[root@salt ~]# salt MYMINION state.highstate
MYMINION:
 [snip]
----------
          ID: zpool scrub zones
    Function: cron.present
      Result: False
     Comment: Cron zpool scrub zones for user root failed to commit with error 
              crontab: illegal option -- u
              crontab: usage:
                crontab [file]
                crontab -e [username]
                crontab -l [-g] [username]
                crontab -r [username]
     Started: 01:32:01.217816
    Duration: 427.723 ms
     Changes:   
[snip]
Summary for MYMINION
------------
Succeeded: 3
Failed:    2
------------
Total states run:     5
Total run time: 850.325 ms

>Fix:
commit ba76062950095850ec165be0be3584624da2046f
Author: Travis Paul <Tr%validusa.com@localhost>
Date:   Wed Dec 16 23:20:36 2015 +0000

    sysutils/salt: Fix cron module for SmartOS

    Upstream PR sent: https://github.com/saltstack/salt/pull/29777

diff --git a/sysutils/salt/Makefile b/sysutils/salt/Makefile
index 2cd7c5a..67cdc71 100644
--- a/sysutils/salt/Makefile
+++ b/sysutils/salt/Makefile
@@ -3,6 +3,7 @@
 DISTNAME=      salt-2015.8.3
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_PYPI:=s/salt/}
+PKGREVISION=   1

 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      http://saltstack.org/
diff --git a/sysutils/salt/distinfo b/sysutils/salt/distinfo
index d64a7c8..0ac5803 100644
--- a/sysutils/salt/distinfo
+++ b/sysutils/salt/distinfo
@@ -4,3 +4,4 @@ SHA1 (salt-2015.8.3.tar.gz) = 0457866d5619febc3cdf3b27b2e736b0c4ae3623
 RMD160 (salt-2015.8.3.tar.gz) = 607db5d35545cfb6c4e8676482133a1560f3e896
 SHA512 (salt-2015.8.3.tar.gz) = 18a2c63d5e54d09468189450557974e47f87d8b7dde52beaae678120da1da1e7aecfff18cf0fdfb63a11cd5f6bab102c229462f0afe5e3e858c0c467761c7121
 Size (salt-2015.8.3.tar.gz) = 6757678 bytes
+SHA1 (patch-salt_modules_cron.py) = e271bfc252c5c9263d9029f2334ba742cc1be199
diff --git a/sysutils/salt/patches/patch-salt_modules_cron.py b/sysutils/salt/patches/patch-salt_modules_cron.py
new file mode 100644
index 0000000..4e5f389
--- /dev/null
+++ b/sysutils/salt/patches/patch-salt_modules_cron.py
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- salt/modules/cron.py.orig  2015-12-15 22:38:23.793040947 +0000
++++ salt/modules/cron.py
+@@ -150,7 +150,7 @@ def _get_cron_cmdstr(path, user=None):
+     '''
+     cmd = 'crontab'
+
+-    if user:
++    if user and __grains__.get('os_family') not in ('Solaris', 'AIX'):
+         cmd += ' -u {0}'.format(user)
+
+     return '{0} {1}'.format(cmd, path)


Home | Main Index | Thread Index | Old Index