[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Nov 8 22:34:01 UTC 2022

The branch, master has been updated
       via  3030813765f gp: Ignore crontab -l error, since it means empty
      from  612eeff2704 tests/krb5: Add tests of PAC group handling


- Log -----------------------------------------------------------------
commit 3030813765ff2f9ef6c894a4e6eb51601fe07109
Author: David Mulder <dmulder at samba.org>
Date:   Tue Nov 8 11:03:36 2022 -0700

    gp: Ignore crontab -l error, since it means empty
    We should not fail when crontab -l errors, this
    just means the crontab is empty.
    Signed-off-by: David Mulder <dmulder at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Nov  8 22:33:37 UTC 2022 on sn-devel-184


Summary of changes:
 python/samba/gp/gp_scripts_ext.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Changeset truncated at 500 lines:

diff --git a/python/samba/gp/gp_scripts_ext.py b/python/samba/gp/gp_scripts_ext.py
index 3ff650996bb..bbf609cf5d5 100644
--- a/python/samba/gp/gp_scripts_ext.py
+++ b/python/samba/gp/gp_scripts_ext.py
@@ -20,6 +20,7 @@ from samba.gp.gpclass import gp_pol_ext, drop_privileges
 from base64 import b64encode
 from hashlib import blake2b
 from tempfile import NamedTemporaryFile
+from samba.gp.util.logging import log
 intro = '''
 ### autogenerated by samba
@@ -98,7 +99,7 @@ def fetch_crontab(username):
     p = Popen(['crontab', '-l', '-u', username], stdout=PIPE, stderr=PIPE)
     out, err = p.communicate()
     if p.returncode != 0:
-        raise RuntimeError('Failed to read the crontab: %s' % err)
+        log.warning('Failed to read the crontab: %s' % err)
     m = re.findall('%s(.*)%s' % (intro, end), out.decode(), re.DOTALL)
     if len(m) == 1:
         entries = m[0].strip().split('\n')

Samba Shared Repository

More information about the samba-cvs mailing list