Skip to content
Snippets Groups Projects
Commit efe9c686 authored by Thomas Woerner's avatar Thomas Woerner
Browse files

ipaservice: Properly Handle certs with leading or trailing white space

Any leading or trailing whitespace is removed while adding the
certificates with serive_add_cert. To be able to compare the results
from service_show with the given certificates we have to remove the
white space also.
parent 0d9873b8
Branches
Tags
No related merge requests found
...@@ -590,6 +590,12 @@ def main(): ...@@ -590,6 +590,12 @@ def main():
# service attributes # service attributes
principal = ansible_module.params_get("principal") principal = ansible_module.params_get("principal")
certificate = ansible_module.params_get("certificate") certificate = ansible_module.params_get("certificate")
# Any leading or trailing whitespace is removed while adding the
# certificate with serive_add_cert. To be able to compare the results
# from service_show with the given certificates we have to remove the
# white space also.
if certificate is not None:
certificate = [cert.strip() for cert in certificate]
pac_type = ansible_module.params_get("pac_type", allow_empty_string=True) pac_type = ansible_module.params_get("pac_type", allow_empty_string=True)
auth_ind = ansible_module.params_get("auth_ind", allow_empty_string=True) auth_ind = ansible_module.params_get("auth_ind", allow_empty_string=True)
skip_host_check = ansible_module.params_get("skip_host_check") skip_host_check = ansible_module.params_get("skip_host_check")
...@@ -649,6 +655,12 @@ def main(): ...@@ -649,6 +655,12 @@ def main():
service_set.add(name) service_set.add(name)
principal = service.get("principal") principal = service.get("principal")
certificate = service.get("certificate") certificate = service.get("certificate")
# Any leading or trailing whitespace is removed while adding
# the certificate with serive_add_cert. To be able to compare
# the results from service_show with the given certificates
# we have to remove the white space also.
if certificate is not None:
certificate = [cert.strip() for cert in certificate]
pac_type = service.get("pac_type") pac_type = service.get("pac_type")
auth_ind = service.get("auth_ind") auth_ind = service.get("auth_ind")
skip_host_check = service.get("skip_host_check") skip_host_check = service.get("skip_host_check")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment