Cluster names can contain invalid characters (according to Ansible standards for group names) and when the Ansible setting TRANSFORM_INVALID_GROUP_CHARS is set to "always" the inventory script will throw exceptions and fail. The add_group method will return the sanitized name, so this will fix the error. It should cause no change in behavior when TRANSFORM_INVALID_GROUP_CHARS is set to the default of "never".
Cluster names can contain invalid characters (according to Ansible standards for group names) and when the Ansible setting TRANSFORM_INVALID_GROUP_CHARS is set to "always" the inventory script will throw exceptions and fail. The add_group method will return the sanitized name, so this will fix the error. It should cause no change in behavior when TRANSFORM_INVALID_GROUP_CHARS is set to the default of "never".
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#transform-invalid-group-chars