nutanix / nutanix.ansible

Official Nutanix Ansible collections
GNU General Public License v3.0
64 stars 36 forks source link

[Imprv] add functionality configure timeout value to module any module, for example vms.py #409

Open ArtemProt opened 11 months ago

ArtemProt commented 11 months ago

Describe the request

Add functionality in modules to override default timeout value for API calls.

Current behaviour

There is module vms.py:

https://github.com/nutanix/nutanix.ansible/blob/main/plugins/module_utils/prism/vms.py

It has hardcode value for time in API calls:

def list( self, data=None, endpoint=None, use_base_url=False, raise_error=True, no_response=False, timeout=30, max_length=500,

In some cases we can see inventory failed and on IKAT of PC it shows ansible-httpget as disconnected after exactly 30 sec. We have tried to change timeout value in ansible settings, but it failed again with exact same timeout 30 secs.

Expected behaviour

Modules should or take ansible-httpget timeout value https://docs.ansible.com/ansible/latest/collections/ansible/builtin/uri_module.html

Or we should allow to change it in any other manner.

bhati-pradeep commented 10 months ago

There was a some misunderstanding regarding the fix in project dashboard and release 1.9.1 doesn't contains fix. Moving it to 1.9.2

@Gevorg-Khachatryan-97 Can you please raise PR and share. Thanks