Fix ssl & docker cert alarms

When ssl & docker_registry certificate expiry alarms were
expected, they were being suppressed due to unknown UUID.
Found the issue to be in the parser of REST response which
should use different keys for ssl/docker_registry and for
ssl_ca certificate types.

Test Plan:
PASS: Alarms are now raised as expected for ssl & docker
      certificate types

Closes-bug: 1951631

Signed-off-by: Sabeel Ansari <Sabeel.Ansari@windriver.com>
Change-Id: I53d853fb1e4dc79aefa64cec1aa23fcd35632f93
This commit is contained in:
Sabeel Ansari 2021-11-19 12:53:17 -05:00
parent 9fe3cb3e65
commit 9f43864472

View File

@ -390,7 +390,11 @@ def get_cert_uuid(certname):
if len(res) == 1:
cert_list = res.get('certificates')
for item in cert_list:
if item['signature'] == certname:
key = 'certtype'
if get_mode(certname) == 'ssl_ca':
key = 'signature'
if item[key] == certname:
ret = item['uuid']
break
except Exception as e: