Status code returned during installation of a new certificate is probably 201 and not 200.
This commit is contained in:
@@ -167,7 +167,7 @@ def installCertificate(hostname, verify, username, password, filename):
|
|||||||
headers = { 'Authorization': 'Bearer %s' % bearer }
|
headers = { 'Authorization': 'Bearer %s' % bearer }
|
||||||
|
|
||||||
r = requests.post(url, headers=headers, data=json.dumps(certificate), verify=verify)
|
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)
|
logger.error('Impossible to install certificate. Status code: %d.' % r.status_code)
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user