mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 16:12:09 +02:00
Adding even more logging to storage.py
This commit is contained in:
+11
-1
@@ -164,7 +164,6 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
|
|||||||
self.cli_config.archive_dir, self.lineagename)
|
self.cli_config.archive_dir, self.lineagename)
|
||||||
if not os.path.samefile(os.path.dirname(target),
|
if not os.path.samefile(os.path.dirname(target),
|
||||||
desired_directory):
|
desired_directory):
|
||||||
#TODO: Split next line correctly
|
|
||||||
logger.debug("Element does not point within the cert "
|
logger.debug("Element does not point within the cert "
|
||||||
"lineage's directory within the official "
|
"lineage's directory within the official "
|
||||||
"archive directory")
|
"archive directory")
|
||||||
@@ -607,6 +606,7 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
|
|||||||
cli_config.live_dir):
|
cli_config.live_dir):
|
||||||
if not os.path.exists(i):
|
if not os.path.exists(i):
|
||||||
os.makedirs(i, 0700)
|
os.makedirs(i, 0700)
|
||||||
|
logger.debug("Creating CLI config directories")
|
||||||
config_file, config_filename = le_util.unique_lineage_name(
|
config_file, config_filename = le_util.unique_lineage_name(
|
||||||
cli_config.renewal_configs_dir, lineagename)
|
cli_config.renewal_configs_dir, lineagename)
|
||||||
if not config_filename.endswith(".conf"):
|
if not config_filename.endswith(".conf"):
|
||||||
@@ -627,6 +627,7 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
|
|||||||
"live directory exists for " + lineagename)
|
"live directory exists for " + lineagename)
|
||||||
os.mkdir(archive)
|
os.mkdir(archive)
|
||||||
os.mkdir(live_dir)
|
os.mkdir(live_dir)
|
||||||
|
logger.debug("Archive and live directories created")
|
||||||
relative_archive = os.path.join("..", "..", "archive", lineagename)
|
relative_archive = os.path.join("..", "..", "archive", lineagename)
|
||||||
|
|
||||||
# Put the data into the appropriate files on disk
|
# Put the data into the appropriate files on disk
|
||||||
@@ -636,15 +637,19 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
|
|||||||
os.symlink(os.path.join(relative_archive, kind + "1.pem"),
|
os.symlink(os.path.join(relative_archive, kind + "1.pem"),
|
||||||
target[kind])
|
target[kind])
|
||||||
with open(target["cert"], "w") as f:
|
with open(target["cert"], "w") as f:
|
||||||
|
logger.debug("Writing certificate")
|
||||||
f.write(cert)
|
f.write(cert)
|
||||||
with open(target["privkey"], "w") as f:
|
with open(target["privkey"], "w") as f:
|
||||||
|
logger.debug("Writing private key")
|
||||||
f.write(privkey)
|
f.write(privkey)
|
||||||
# XXX: Let's make sure to get the file permissions right here
|
# XXX: Let's make sure to get the file permissions right here
|
||||||
with open(target["chain"], "w") as f:
|
with open(target["chain"], "w") as f:
|
||||||
|
logger.debug("Writing chain")
|
||||||
f.write(chain)
|
f.write(chain)
|
||||||
with open(target["fullchain"], "w") as f:
|
with open(target["fullchain"], "w") as f:
|
||||||
# assumes that OpenSSL.crypto.dump_certificate includes
|
# assumes that OpenSSL.crypto.dump_certificate includes
|
||||||
# ending newline character
|
# ending newline character
|
||||||
|
logger.debug("Writing full chain")
|
||||||
f.write(cert + chain)
|
f.write(cert + chain)
|
||||||
|
|
||||||
# Document what we've done in a new renewal config file
|
# Document what we've done in a new renewal config file
|
||||||
@@ -659,6 +664,7 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
|
|||||||
" in the renewal process"]
|
" in the renewal process"]
|
||||||
# TODO: add human-readable comments explaining other available
|
# TODO: add human-readable comments explaining other available
|
||||||
# parameters
|
# parameters
|
||||||
|
logger.debug("Writing new config")
|
||||||
new_config.write()
|
new_config.write()
|
||||||
return cls(new_config.filename, cli_config)
|
return cls(new_config.filename, cli_config)
|
||||||
|
|
||||||
@@ -712,13 +718,17 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
|
|||||||
os.symlink(old_privkey, target["privkey"])
|
os.symlink(old_privkey, target["privkey"])
|
||||||
else:
|
else:
|
||||||
with open(target["privkey"], "w") as f:
|
with open(target["privkey"], "w") as f:
|
||||||
|
logger.debug("Writing new private key")
|
||||||
f.write(new_privkey)
|
f.write(new_privkey)
|
||||||
|
|
||||||
# Save everything else
|
# Save everything else
|
||||||
with open(target["cert"], "w") as f:
|
with open(target["cert"], "w") as f:
|
||||||
|
logger.debug("Writing certificate")
|
||||||
f.write(new_cert)
|
f.write(new_cert)
|
||||||
with open(target["chain"], "w") as f:
|
with open(target["chain"], "w") as f:
|
||||||
|
logger.debug("Writing chain")
|
||||||
f.write(new_chain)
|
f.write(new_chain)
|
||||||
with open(target["fullchain"], "w") as f:
|
with open(target["fullchain"], "w") as f:
|
||||||
|
logger.debug("Writing full chain")
|
||||||
f.write(new_cert + new_chain)
|
f.write(new_cert + new_chain)
|
||||||
return target_version
|
return target_version
|
||||||
|
|||||||
Reference in New Issue
Block a user