ApacheConfigurator.is_enabled using filecmp (fixes #838).

This commit is contained in:
Jakub Warmuz 2015-10-11 10:51:24 +00:00
parent 013d5d2ea9
commit 5edd809161
No known key found for this signature in database
GPG key ID: 2A7BAD3A489B52EA

View file

@ -1,5 +1,6 @@
"""Apache Configuration based off of Augeas Configurator."""
# pylint: disable=too-many-lines
import filecmp
import itertools
import logging
import os
@ -945,9 +946,11 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
"""
enabled_dir = os.path.join(self.parser.root, "sites-enabled")
for entry in os.listdir(enabled_dir):
if os.path.realpath(os.path.join(enabled_dir, entry)) == avail_fp:
return True
try:
if filecmp.cmp(avail_fp, os.path.join(enabled_dir, entry)):
return True
except OSError:
pass
return False
def enable_site(self, vhost):