[SCM] Samba Shared Repository - branch master updated

David Mulder dmulder at samba.org
Wed Apr 19 21:22:02 UTC 2023


The branch, master has been updated
       via  6e525d55d98 gp: Fix NameError: free variable 'cron_dir' in Crontab CSE
      from  af91bcb3593 pylibsmb: Return "flags" in create_returns

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6e525d55d98568ac6f0f89b78de5a4cebedb0dc2
Author: David Mulder <dmulder at samba.org>
Date:   Tue Apr 18 13:34:46 2023 -0600

    gp: Fix NameError: free variable 'cron_dir' in Crontab CSE
    
    An apply reports the error "NameError: free
    variable 'cron_dir' referenced before assignment
    in enclosing scope". This only happens when no
    policy is defined for this CSE, because existing
    policy causes the variable to be defined.
    
    Moved the 'cron_dir' varilable to the correct
    scope.
    
    Signed-off-by: David Mulder <dmulder at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): David Mulder <dmulder at samba.org>
    Autobuild-Date(master): Wed Apr 19 21:21:10 UTC 2023 on atb-devel-224

-----------------------------------------------------------------------

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


Changeset truncated at 500 lines:

diff --git a/python/samba/gp/gp_centrify_crontab_ext.py b/python/samba/gp/gp_centrify_crontab_ext.py
index 414cd90aaf7..e8ffd8bec9f 100644
--- a/python/samba/gp/gp_centrify_crontab_ext.py
+++ b/python/samba/gp/gp_centrify_crontab_ext.py
@@ -57,9 +57,9 @@ class gp_centrify_crontab_ext(gp_pol_ext, gp_file_applier):
                 entries = []
                 for e in pol_conf.entries:
                     if e.keyname == section and e.data.strip():
-                        cron_dir = '/etc/cron.d' if not cdir else cdir
                         entries.append(e.data)
                 def applier_func(entries):
+                    cron_dir = '/etc/cron.d' if not cdir else cdir
                     with NamedTemporaryFile(prefix='gp_', mode="w+",
                             delete=False, dir=cron_dir) as f:
                         contents = intro


-- 
Samba Shared Repository



More information about the samba-cvs mailing list