mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Merge pull request #2187 from letsencrypt/symlink-problems
Fix tests on letsencrypt-apache packages
This commit is contained in:
commit
b030341415
1 changed files with 14 additions and 0 deletions
|
|
@ -42,6 +42,20 @@ class ApacheTest(unittest.TestCase): # pylint: disable=too-few-public-methods
|
|||
self.rsa512jwk = jose.JWKRSA.load(test_util.load_vector(
|
||||
"rsa512_key.pem"))
|
||||
|
||||
# Make sure all vhosts in sites-enabled are symlinks (Python packaging
|
||||
# does not preserve symlinks)
|
||||
sites_enabled = os.path.join(self.config_path, "sites-enabled")
|
||||
if not os.path.exists(sites_enabled):
|
||||
return
|
||||
|
||||
for vhost_basename in os.listdir(sites_enabled):
|
||||
vhost = os.path.join(sites_enabled, vhost_basename)
|
||||
if not os.path.islink(vhost): # pragma: no cover
|
||||
os.remove(vhost)
|
||||
target = os.path.join(
|
||||
os.path.pardir, "sites-available", vhost_basename)
|
||||
os.symlink(target, vhost)
|
||||
|
||||
|
||||
class ParserTest(ApacheTest): # pytlint: disable=too-few-public-methods
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue