mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-03-31 15:53:24 +00:00
acme_* modules: make sure 'meta' is always in directory (#221)
* Make sure 'meta' is always in directory. * Update plugins/module_utils/acme/acme.py
This commit is contained in:
2
changelogs/fragments/221-acme-meta.yml
Normal file
2
changelogs/fragments/221-acme-meta.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- "acme_* modules - avoid crashing for ACME servers where the ``meta`` directory key is not present (https://github.com/ansible-collections/community.crypto/issues/220, https://github.com/ansible-collections/community.crypto/pull/221)."
|
||||
@@ -82,6 +82,9 @@ class ACMEDirectory(object):
|
||||
for key in ('newNonce', 'newAccount', 'newOrder'):
|
||||
if key not in self.directory:
|
||||
raise ModuleFailException("ACME directory does not seem to follow protocol ACME v2")
|
||||
# Make sure that 'meta' is always available
|
||||
if 'meta' not in self.directory:
|
||||
self.directory['meta'] = {}
|
||||
|
||||
def __getitem__(self, key):
|
||||
return self.directory[key]
|
||||
|
||||
Reference in New Issue
Block a user