diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index b37f366..1530857 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -1470,15 +1470,8 @@ class WOSiteUpdateController(CementBaseController): .format(wo_site_webroot)) # find all broken symlinks sympath = "/var/www" - sslconf = ("{0}/conf/nginx/ssl.conf" - .format(wo_site_webroot)) - symlinks = WOFileUtils.findBrokenSymlink(self, sympath) + WOFileUtils.findBrokenSymlink(self, sympath) - for symlink in symlinks: - wo_symlink = os.readlink('{0}'.format(symlink)) - if wo_symlink == sslconf: - # remove broken symlinks - WOFileUtils.remove_symlink(self, symlink) elif (pargs.letsencrypt == "clean" or pargs.letsencrypt == "purge"): removeAcmeConf(self, wo_domain) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 18dd3f0..9b4d1eb 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -1266,13 +1266,8 @@ def removeAcmeConf(self, domain): # find all broken symlinks sympath = "/var/www" - symlinks = WOFileUtils.findBrokenSymlink(self, sympath) + WOFileUtils.findBrokenSymlink(self, sympath) - for symlink in symlinks: - wo_symlink = os.readlink('{0}'.format(symlink)) - if wo_symlink == sslconf: - # remove broken symlinks - WOFileUtils.remove_symlink(self, symlink) else: if os.path.islink("{0}".format(sslconf)): WOFileUtils.remove_symlink(self, "{0}".format(sslconf)) diff --git a/wo/core/fileutils.py b/wo/core/fileutils.py index 7450b61..cc6678f 100644 --- a/wo/core/fileutils.py +++ b/wo/core/fileutils.py @@ -302,10 +302,10 @@ class WOFileUtils(): if not os.path.exists(target_path): links.append(path) broken.append(path) + os.remove(path) else: links.append(path) else: # If it's not a symlink we're not interested. continue - - return broken + return True