mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Fixing bug introduced in 20622
This commit is contained in:
parent
7d7051fc54
commit
91c1d8d8e2
1 changed files with 2 additions and 5 deletions
|
@ -142,14 +142,11 @@ def dup_check(module, iam, name, new_name, cert, orig_cert_names, orig_cert_bodi
|
||||||
update = False
|
update = False
|
||||||
|
|
||||||
# IAM cert names are case insensitive
|
# IAM cert names are case insensitive
|
||||||
names_lower = [n.lower() for n in [name, new_name]]
|
names_lower = [n.lower() for n in [name, new_name] if n is not None]
|
||||||
orig_cert_names_lower = [ocn.lower() for ocn in orig_cert_names]
|
orig_cert_names_lower = [ocn.lower() for ocn in orig_cert_names]
|
||||||
|
|
||||||
if any(ct in orig_cert_names_lower for ct in names_lower):
|
if any(ct in orig_cert_names_lower for ct in names_lower):
|
||||||
for i_name in names_lower:
|
for i_name in names_lower:
|
||||||
if i_name is None:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if cert is not None:
|
if cert is not None:
|
||||||
try:
|
try:
|
||||||
c_index = orig_cert_names_lower.index(i_name)
|
c_index = orig_cert_names_lower.index(i_name)
|
||||||
|
@ -168,7 +165,7 @@ def dup_check(module, iam, name, new_name, cert, orig_cert_names, orig_cert_bodi
|
||||||
elif slug_orig_cert_bodies != slug_cert:
|
elif slug_orig_cert_bodies != slug_cert:
|
||||||
module.fail_json(changed=False, msg='A cert with the name %s already exists and'
|
module.fail_json(changed=False, msg='A cert with the name %s already exists and'
|
||||||
' has a different certificate body associated'
|
' has a different certificate body associated'
|
||||||
' with it. Certificates cannot have the same name' % i_name)
|
' with it. Certificates cannot have the same name' % orig_cert_names[c_index])
|
||||||
else:
|
else:
|
||||||
update = True
|
update = True
|
||||||
break
|
break
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue