File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 51
51
else :
52
52
print ("Error importing certificate!" )
53
53
print (r )
54
- sys .exit (1 )
54
+ sys .exit (1 )
55
55
56
56
# Download certificate list
57
57
limit = {'limit' : 0 } # set limit to 0 to disable paging in the event of many certificates
66
66
print ("Error listing certificates!" )
67
67
print (r )
68
68
sys .exit (1 )
69
-
69
+
70
70
# Parse certificate list to find the id that matches our cert name
71
71
cert_list = r .json ()
72
72
84
84
data = json .dumps ({
85
85
"stg_guicertificate" : cert_id ,
86
86
}),
87
- )
87
+ )
88
88
89
89
if r .status_code == 200 :
90
90
print ("Setting active certificate successful" )
94
94
sys .exit (1 )
95
95
96
96
# Reload nginx with new cert
97
- r = requests .post (
98
- PROTOCOL + DOMAIN_NAME + '/api/v1.0/system/settings/restart-httpd-all/' ,
99
- auth = (USER , PASSWORD ),
100
- )
97
+ try :
98
+ r = requests .post (
99
+ PROTOCOL + DOMAIN_NAME + '/api/v1.0/system/settings/restart-httpd-all/' ,
100
+ auth = (USER , PASSWORD ),
101
+ )
102
+ except requests .exceptions .ConnectionError :
103
+ pass # This is expected when restarting the web server
You can’t perform that action at this time.
0 commit comments