Status code returned during installation of a new certificate is probably 201 and not 200.

This commit is contained in:
Frédéric Tronel
2024-08-09 17:01:12 +02:00
parent fd854e9905
commit 3443916d14

View File

@@ -167,7 +167,7 @@ def installCertificate(hostname, verify, username, password, filename):
headers = { 'Authorization': 'Bearer %s' % bearer }
r = requests.post(url, headers=headers, data=json.dumps(certificate), verify=verify)
if r.status_code != 200:
if r.status_code != 200 or r.status_code != 201:
logger.error('Impossible to install certificate. Status code: %d.' % r.status_code)
exit(-1)