mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:02:52 +02:00
Add line number to Augeas syntax error message (#3974)
* Add line number to Augeas syntax error message * Use `format()` for message formatting * Pleasing Python 2.6
This commit is contained in:
committed by
Peter Eckersley
parent
1125b4924d
commit
f9b8933f37
@@ -68,9 +68,12 @@ class AugeasConfigurator(common.Plugin):
|
|||||||
# As aug.get may return null
|
# As aug.get may return null
|
||||||
if lens_path and lens in lens_path:
|
if lens_path and lens in lens_path:
|
||||||
msg = (
|
msg = (
|
||||||
"There has been an error in parsing the file (%s): %s",
|
"There has been an error in parsing the file {0} on line {1}: "
|
||||||
|
"{2}".format(
|
||||||
# Strip off /augeas/files and /error
|
# Strip off /augeas/files and /error
|
||||||
path[13:len(path) - 6], self.aug.get(path + "/message"))
|
path[13:len(path) - 6],
|
||||||
|
self.aug.get(path + "/line"),
|
||||||
|
self.aug.get(path + "/message")))
|
||||||
raise errors.PluginError(msg)
|
raise errors.PluginError(msg)
|
||||||
|
|
||||||
# TODO: Cleanup this function
|
# TODO: Cleanup this function
|
||||||
|
|||||||
Reference in New Issue
Block a user