diff --git a/python/samba/gp_sudoers_ext.py b/python/samba/gp_sudoers_ext.py index 673b0e131c6..a693fc960a2 100644 --- a/python/samba/gp_sudoers_ext.py +++ b/python/samba/gp_sudoers_ext.py @@ -51,7 +51,8 @@ class gp_sudoers_ext(gp_pol_ext): self.gp_db.set_guid(guid) if str(self) in settings: for attribute, sudoers in settings[str(self)].items(): - os.unlink(sudoers) + if os.path.exists(sudoers): + os.unlink(sudoers) self.gp_db.delete(str(self), attribute) self.gp_db.commit()