1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

gpo: Script ext should not crash if script missing

If a user has manually removed a script, the
extension should not crash in an unapply removing
it.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
David Mulder 2020-08-07 13:39:18 -06:00 committed by David Mulder
parent 7c6969e9c9
commit 87fe86270e

View File

@ -39,7 +39,8 @@ class gp_scripts_ext(gp_pol_ext):
self.gp_db.set_guid(guid)
if str(self) in settings:
for attribute, script in settings[str(self)].items():
os.unlink(script)
if os.path.exists(script):
os.unlink(script)
self.gp_db.delete(str(self), attribute)
self.gp_db.commit()