Options variables aren't extracted

I’m running on Ansible version 2.15.8 with the latest Check Point MGMT collection, and i noticed that suddenly i cant use the options.
Our httpapi plugin has several options, for example domain (snippet from checkpony.py httpapi plugin)

options:
  domain:
    type: str
    description:
      - Specifies the domain of the Check Point device
    vars:
      - name: ansible_checkpoint_domain

Below is my inventory.ini file content:

[my_hosts]
target_host ansible_connection=httpapi ansible_httpapi_host=172.23.3.10 ansible_host=172.23.3.10 ansible_httpapi_use_ssl=true ansible_httpapi_validate_certs=false ansible_network_os=check_point.mgmt.checkpoint ansible_user=aa ansible_password=aaaa

[my_hosts:vars]
ansible_checkpoint_domain=dom1

and i noticed that when running a playbook the plugin isn’t extracting the option correctly, i’ve added a print of cp_domain and got ‘None’,
image

but when running the task below in my playbook:

    - name: Print inventory variable
      ansible.builtin.debug:
        var: ansible_checkpoint_domain

i get the correct output

TASK [Print inventory variable] ************************************************************************************************
ok: [target_host] => {
“ansible_checkpoint_domain”: “dom1”
}

I ran my playbook in an ansible 2.12 virtual environment and the options were extracted successfully, when doing so in a different virtual environment version 2.14 it didn’t seem to do so.

I cannot replicate your issue with stable-2.14, stable-2.15, or stable-2.16 and the information you provided.

I used your inventory with the following playbook:

- hosts: target_host
  gather_facts: false
  tasks:
    - check_point.mgmt.cp_mgmt_add_api_key:
        admin_name: foo

and this patch:

diff --git a/plugins/httpapi/checkpoint.py b/plugins/httpapi/checkpoint.py
index 6e8f45e..76a3a1b 100644
--- a/plugins/httpapi/checkpoint.py
+++ b/plugins/httpapi/checkpoint.py
@@ -59,6 +59,7 @@ class HttpApi(HttpApiBase):
     def login(self, username, password):
         payload = {}
         cp_domain = self.get_option("domain")
+        raise Exception(cp_domain)
         cp_api_key = self.get_option("api_key")
         if cp_domain:
             payload["domain"] = cp_domain

The result was, as expected,

TASK [check_point.mgmt.cp_mgmt_add_api_key] ************************************
An exception occurred during task execution. To see the full traceback, use -vvv
. The error was: ansible.module_utils.connection.ConnectionError: dom1

I do recall an issue with very old versions of ansible.netcommon and httpapi plugin options; you might want to make sure you don’t have an old install of that collection lying around.

stable-2.17 and on are broken due to an import that was removed in October 2023, which is a worrying amount of time for the collection developers to not have noticed that their collection is completely broken.