File fix-crontab-module-file-attributes-option-missing-bs.patch of Package salt.10902

From d10f016ee8976beb775e4be06e486f5d1acfe8e9 Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo@maryniuk.net>
Date: Tue, 13 Nov 2018 10:56:40 +0100
Subject: [PATCH] Fix crontab module: file attributes option missing
 (bsc#1114824) (#113)

---
 salt/states/cron.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/salt/states/cron.py b/salt/states/cron.py
index 0735391a8c..80292d868f 100644
--- a/salt/states/cron.py
+++ b/salt/states/cron.py
@@ -606,6 +606,7 @@ def file(name,
             user,
             group,
             mode,
+            [],           # No attrs for cron
             __env__,
             context,
             defaults,
@@ -634,6 +635,7 @@ def file(name,
             user,
             group,
             mode,
+            [],    # No attrs for cron
             __env__,
             backup
         )
@@ -643,14 +645,13 @@ def file(name,
         ret['comment'] = 'Unable to manage file: {0}'.format(exc)
         return ret
 
-    cron_ret = None
     if "diff" in ret['changes']:
         cron_ret = __salt__['cron.write_cron_file_verbose'](user, cron_path)
         # Check cmd return code and show success or failure
         if cron_ret['retcode'] == 0:
             ret['comment'] = 'Crontab for user {0} was updated'.format(user)
             ret['result'] = True
-            ret['changes'] = ret['changes']['diff']
+            ret['changes'] = {'diff': ret['changes']['diff']}
         else:
             ret['comment'] = 'Unable to update user {0} crontab {1}.' \
                              ' Error: {2}'.format(user, cron_path, cron_ret['stderr'])
-- 
2.19.1


openSUSE Build Service is sponsored by