mirror of
https://github.com/certbot/certbot.git
synced 2026-06-05 14:54:24 -04:00
Added error handling for Augeas save files
This commit is contained in:
parent
94d1827838
commit
de89d1fe63
1 changed files with 7 additions and 2 deletions
|
|
@ -176,7 +176,12 @@ class Configurator(object):
|
|||
nvhPath = ifModPath + "directive[1]"
|
||||
self.aug.set(nvhPath, directive)
|
||||
self.aug.set(nvhPath + "/arg", val)
|
||||
self.aug.save()
|
||||
try:
|
||||
self.aug.save()
|
||||
except IOError:
|
||||
print "Unable to save file - Is the script running as root?"
|
||||
return False
|
||||
return True
|
||||
|
||||
def make_server_sni_ready(self, addr):
|
||||
"""
|
||||
|
|
@ -370,7 +375,7 @@ def main():
|
|||
for a in v.addrs:
|
||||
print a, config.is_name_vhost(a)
|
||||
|
||||
print config.make_server_sni_ready("127.0.0.1:443")
|
||||
print config.make_server_sni_ready("example.com:443")
|
||||
|
||||
#for m in config.aug.match("/augeas/load/Httpd/incl"):
|
||||
# print m, config.aug.get(m)
|
||||
|
|
|
|||
Loading…
Reference in a new issue