diff --git a/changelogs/fragments/64501-fix-python2.x-backward-compatibility.yaml b/changelogs/fragments/64501-fix-python2.x-backward-compatibility.yaml new file mode 100644 index 0000000000..42c4761c23 --- /dev/null +++ b/changelogs/fragments/64501-fix-python2.x-backward-compatibility.yaml @@ -0,0 +1,2 @@ +bugfixes: +- "acme_certificate - fix crash when module is used with Python 2.x." diff --git a/lib/ansible/modules/crypto/acme/acme_certificate.py b/lib/ansible/modules/crypto/acme/acme_certificate.py index 9527a872c9..de94e9c546 100644 --- a/lib/ansible/modules/crypto/acme/acme_certificate.py +++ b/lib/ansible/modules/crypto/acme/acme_certificate.py @@ -859,7 +859,7 @@ class ACMEClient(object): if relation == 'up': chain_result, chain_info = self.account.get_request(link, parse_json_result=False) if chain_info['status'] in [200, 201]: - chain.clear() + del chain[:] chain.append(self._der_to_pem(chain_result)) process_links(info, f)