Skip to content

Commit bacc4d6

Browse files
committed
update
1 parent e3df230 commit bacc4d6

File tree

1 file changed

+30
-25
lines changed

1 file changed

+30
-25
lines changed

dags/nycmesh_generate_omni_cert.py

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -77,31 +77,36 @@ def generate_certbot_tsig_cert(fqdn_string, dns_server, tsig_key_name, tsig_key)
7777

7878
config_dir = "/tmp/certbot_config"
7979
# Get the cert from Let's Encrypt
80-
completed = subprocess.run([
81-
"certbot",
82-
"certonly",
83-
"--dns-rfc2136",
84-
"--dns-rfc2136-credentials",
85-
tsig_ini_file_path,
86-
"--dns-rfc2136-propagation-seconds",
87-
"310",
88-
"--non-interactive",
89-
"--agree-tos",
90-
"-m",
91-
"jameso@nycmesh.net",
92-
"-d",
93-
fqdn_string,
94-
"--config-dir",
95-
config_dir,
96-
"--work-dir",
97-
"/tmp/certbot_work",
98-
"--logs-dir",
99-
"/tmp/certbot_logs",
100-
"-v",
101-
], check=True)
102-
103-
print(completed.stdout)
104-
print(completed.stderr)
80+
try:
81+
completed = subprocess.run([
82+
"certbot",
83+
"certonly",
84+
"--dns-rfc2136",
85+
"--dns-rfc2136-credentials",
86+
tsig_ini_file_path,
87+
"--dns-rfc2136-propagation-seconds",
88+
"310",
89+
"--non-interactive",
90+
"--agree-tos",
91+
"-m",
92+
"jameso@nycmesh.net",
93+
"-d",
94+
fqdn_string,
95+
"--config-dir",
96+
config_dir,
97+
"--work-dir",
98+
"/tmp/certbot_work",
99+
"--logs-dir",
100+
"/tmp/certbot_logs",
101+
"-v",
102+
], check=True)
103+
104+
print(completed.stdout)
105+
print(completed.stderr)
106+
except Exception as e:
107+
with open("/tmp/certbot_logs/letsencrypt.log","r") as fd:
108+
print("debug log:")
109+
print(fd.read)
105110

106111
# Path(tsig_ini_file_path).unlink()
107112

0 commit comments

Comments
 (0)