From 89d907b1822993623ba9cc18b5fcfe231f6676d5 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 7 Jun 2019 10:57:21 -0700 Subject: [PATCH] Improve Apache error message when run with insufficient privileges (#7129) * fixes #6369 * Add changelog entry. * Improve error message again. --- CHANGELOG.md | 5 +++-- certbot-apache/certbot_apache/configurator.py | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ad479282..be50f44f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). ### Changed -* +* The error message when Certbot's Apache plugin is unable to modify your + Apache configuration has been improved. ### Fixed @@ -20,7 +21,7 @@ Despite us having broken lockstep, we are continuing to release new versions of all Certbot components during releases for the time being, however, the only package with changes other than its version number was: -* +* certbot-apache More details about these changes can be found on our GitHub repo. diff --git a/certbot-apache/certbot_apache/configurator.py b/certbot-apache/certbot_apache/configurator.py index 9174143a4..37f8ba289 100644 --- a/certbot-apache/certbot_apache/configurator.py +++ b/certbot-apache/certbot_apache/configurator.py @@ -276,7 +276,10 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): util.lock_dir_until_exit(self.option("server_root")) except (OSError, errors.LockError): logger.debug("Encountered error:", exc_info=True) - raise errors.PluginError("Unable to lock {0}".format(self.option("server_root"))) + raise errors.PluginError( + "Unable to create a lock file in {0}. Are you running" + " Certbot with sufficient privileges to modify your" + " Apache configuration?".format(self.option("server_root"))) self._prepared = True def _verify_exe_availability(self, exe):