Fix consul_token usage without accessor_id. (#8091)

* Fix consul_token usage without accessor_id.

* Update changelogs/fragments/8091-consul-token-fixes.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/consul_token.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Florian Apolloner 2024-03-14 23:14:37 +01:00 committed by GitHub
parent 226207522e
commit 67736d796a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 1 deletions

View file

@ -277,7 +277,7 @@ class _ConsulModule:
headers["X-Consul-Token"] = token
try:
if data:
if data is not None:
data = json.dumps(data)
headers["Content-Type"] = "application/json"
if params: