mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix stackpath_compute validate_config (#2448)
* fix stackpath_compute validate_config get the lenght for the client_id / client_secret to validate inventory configuration * Add changelog fragment. Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
7386326258
commit
4cdff8654a
2 changed files with 4 additions and 2 deletions
2
changelogs/fragments/2448-stackpath_compute-fix.yml
Normal file
2
changelogs/fragments/2448-stackpath_compute-fix.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "stackpath_compute inventory script - fix broken validation checks for client ID and client secret (https://github.com/ansible-collections/community.general/pull/2448)."
|
|
@ -102,13 +102,13 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||||
raise AnsibleError("plugin doesn't match this plugin")
|
raise AnsibleError("plugin doesn't match this plugin")
|
||||||
try:
|
try:
|
||||||
client_id = config['client_id']
|
client_id = config['client_id']
|
||||||
if client_id != 32:
|
if len(client_id) != 32:
|
||||||
raise AnsibleError("client_id must be 32 characters long")
|
raise AnsibleError("client_id must be 32 characters long")
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise AnsibleError("config missing client_id, a required option")
|
raise AnsibleError("config missing client_id, a required option")
|
||||||
try:
|
try:
|
||||||
client_secret = config['client_secret']
|
client_secret = config['client_secret']
|
||||||
if client_secret != 64:
|
if len(client_secret) != 64:
|
||||||
raise AnsibleError("client_secret must be 64 characters long")
|
raise AnsibleError("client_secret must be 64 characters long")
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise AnsibleError("config missing client_id, a required option")
|
raise AnsibleError("config missing client_id, a required option")
|
||||||
|
|
Loading…
Reference in a new issue