Skip to content

Commit 2fa147d

Browse files
fix and simplify if statement
1 parent 18706f4 commit 2fa147d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

renew_mit_certs.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
NON_SCRIPTS_VHOSTS_ALIAS = ["sipb.mit.edu"]
1717

18+
1819
def get_expiring_certs():
1920
"""
2021
Most of this function is from find_expiring_certs.py
@@ -53,7 +54,9 @@ def get_expiring_certs():
5354
def renew_expiring_mit_certs():
5455
expiring = get_expiring_certs()
5556
for _, uid, hostnames in expiring:
56-
mit_hostnames = [h for h in hostnames if not ('.' in h and not 'mit.edu' in h)]
57+
mit_hostnames = [
58+
h for h in hostnames if '.' not in h or h.endswith('.mit.edu')
59+
]
5760
if 'mit.edu' in hostnames[0]:
5861
try:
5962
hostnames = request_cert(uid, mit_hostnames)

0 commit comments

Comments
 (0)