diff --git a/changelogs/fragments/2448-stackpath_compute-fix.yml b/changelogs/fragments/2448-stackpath_compute-fix.yml new file mode 100644 index 0000000000..196db780b1 --- /dev/null +++ b/changelogs/fragments/2448-stackpath_compute-fix.yml @@ -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)." diff --git a/plugins/inventory/stackpath_compute.py b/plugins/inventory/stackpath_compute.py index 393edac384..fb879e869e 100644 --- a/plugins/inventory/stackpath_compute.py +++ b/plugins/inventory/stackpath_compute.py @@ -102,13 +102,13 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): raise AnsibleError("plugin doesn't match this plugin") try: client_id = config['client_id'] - if client_id != 32: + if len(client_id) != 32: raise AnsibleError("client_id must be 32 characters long") except KeyError: raise AnsibleError("config missing client_id, a required option") try: client_secret = config['client_secret'] - if client_secret != 64: + if len(client_secret) != 64: raise AnsibleError("client_secret must be 64 characters long") except KeyError: raise AnsibleError("config missing client_id, a required option")