from base64 import b64encode
from hashlib import blake2b
from tempfile import NamedTemporaryFile
+from samba.gp.util.logging import log
intro = '''
### autogenerated by samba
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')