mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 13:22:58 +00:00
Apply suggestions from code review
Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
minor_changes:
|
||||
- "acme_certificate - the ``subject`` and ``issuer`` fields in in the ``select_chain`` entries are now stricter validated (https://github.com/ansible-collections/community.crypto/pull/316)."
|
||||
- "acme_certificate - the ``subject`` and ``issuer`` fields in in the ``select_chain`` entries are now more strictly validated (https://github.com/ansible-collections/community.crypto/pull/316)."
|
||||
- "openssl_csr, openssl_csr_pipe - there is now stricter validation of the values of the ``subject`` option (https://github.com/ansible-collections/community.crypto/pull/316)."
|
||||
- "openssl_csr, openssl_csr_pipe - provide a new ``subject_ordered`` option if the order of the components in the subject is of importance (https://github.com/ansible-collections/community.crypto/issues/291, https://github.com/ansible-collections/community.crypto/pull/316)."
|
||||
- "x509_crl - there is now stricter validation of the values of the ``issuer`` option (https://github.com/ansible-collections/community.crypto/pull/316)."
|
||||
|
||||
@@ -253,9 +253,9 @@ def parse_name_field(input_dict, name_field_name=None):
|
||||
result.append((key, value))
|
||||
else:
|
||||
if name_field_name:
|
||||
raise ValueError(
|
||||
raise TypeError(
|
||||
'Value for {key} in {name} must be either a string or a list of strings'.format(key=key, name=name_field_name))
|
||||
raise ValueError('Value for {key} must be either a string or a list of strings'.format(key=key))
|
||||
raise TypeError('Value for {key} must be either a string or a list of strings'.format(key=key))
|
||||
return result
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ def parse_ordered_name_field(input_list, name_field_name):
|
||||
name=name_field_name, index=index + 1))
|
||||
try:
|
||||
result.extend(parse_name_field(entry, name_field_name=name_field_name))
|
||||
except ValueError as exc:
|
||||
except (TypeError, ValueError) as exc:
|
||||
raise ValueError(
|
||||
'Error while processing entry #{index} in {name}: {error}'.format(
|
||||
name=name_field_name, index=index + 1, error=exc))
|
||||
|
||||
Reference in New Issue
Block a user