acme_* modules: make sure 'meta' is always in directory (#221)
* Make sure 'meta' is always in directory. * Update plugins/module_utils/acme/acme.pypull/222/head
parent
201920d161
commit
f4334d7307
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue