mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix removal of ipa-kdc-proxy.conf symlink
installutils.remove_file() ignored broken symlinks. Now it uses os.path.lexists() to detect and also remove dangling symlinks. Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
This commit is contained in:
parent
5e92c981b0
commit
2842a83568
@ -481,8 +481,8 @@ class HTTPInstance(service.Service):
|
|||||||
installutils.remove_file(paths.HTTPD_IPA_REWRITE_CONF)
|
installutils.remove_file(paths.HTTPD_IPA_REWRITE_CONF)
|
||||||
installutils.remove_file(paths.HTTPD_IPA_CONF)
|
installutils.remove_file(paths.HTTPD_IPA_CONF)
|
||||||
installutils.remove_file(paths.HTTPD_IPA_PKI_PROXY_CONF)
|
installutils.remove_file(paths.HTTPD_IPA_PKI_PROXY_CONF)
|
||||||
installutils.remove_file(paths.HTTPD_IPA_KDCPROXY_CONF)
|
|
||||||
installutils.remove_file(paths.HTTPD_IPA_KDCPROXY_CONF_SYMLINK)
|
installutils.remove_file(paths.HTTPD_IPA_KDCPROXY_CONF_SYMLINK)
|
||||||
|
installutils.remove_file(paths.HTTPD_IPA_KDCPROXY_CONF)
|
||||||
|
|
||||||
# Restore SELinux boolean states
|
# Restore SELinux boolean states
|
||||||
boolean_states = {name: self.restore_state(name)
|
boolean_states = {name: self.restore_state(name)
|
||||||
|
@ -657,7 +657,7 @@ def remove_file(filename):
|
|||||||
Remove a file and log any exceptions raised.
|
Remove a file and log any exceptions raised.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if os.path.exists(filename):
|
if os.path.lexists(filename):
|
||||||
os.unlink(filename)
|
os.unlink(filename)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
root_logger.error('Error removing %s: %s' % (filename, str(e)))
|
root_logger.error('Error removing %s: %s' % (filename, str(e)))
|
||||||
|
Loading…
Reference in New Issue
Block a user