Use the --force option for every question.

fix #12
This commit is contained in:
Antoine Nguyen
2016-06-07 10:05:16 +02:00
parent eb780d3f58
commit b20400fd98
3 changed files with 16 additions and 13 deletions

View File

@@ -29,10 +29,11 @@ class SelfSignedCertificate(CertificateBackend):
def create(self):
"""Create a certificate."""
if os.path.exists(self.config.get("general", "tls_key_file")):
answer = utils.user_input(
"Overwrite the existing SSL certificate? (y/N) ")
if not answer.lower().startswith("y"):
return
if not self.config.getboolean("general", "force"):
answer = utils.user_input(
"Overwrite the existing SSL certificate? (y/N) ")
if not answer.lower().startswith("y"):
return
utils.printcolor(
"Generating new self-signed certificate", utils.YELLOW)
utils.exec_cmd(