mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04: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:
parent
1125b4924d
commit
f9b8933f37
1 changed files with 5 additions and 2 deletions
|
|
@ -68,9 +68,12 @@ class AugeasConfigurator(common.Plugin):
|
|||
# As aug.get may return null
|
||||
if lens_path and lens in lens_path:
|
||||
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
|
||||
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)
|
||||
|
||||
# TODO: Cleanup this function
|
||||
|
|
|
|||
Loading…
Reference in a new issue