Estimated time
10-15 minutes
Exact files to change
python/ontap_client.py (the from_env() classmethod)
python/README.md (the env-var section)
Expected outcome
OntapClient.from_env() reads an optional ONTAP_TIMEOUT env var
(defaults to the existing _DEFAULT_TIMEOUT of 30 seconds) and passes it
as the constructor timeout= argument. README documents the new env var
alongside ONTAP_HOST, ONTAP_USER, ONTAP_PASS, ONTAP_VERIFY_SSL.
How to test
ONTAP_HOST=10.0.0.1 ONTAP_PASS=x ONTAP_TIMEOUT=2 python cluster_info.py
Against an unreachable host, this fails within ~2 seconds. With
ONTAP_TIMEOUT unset, behavior is unchanged (30s default).
ONTAP concepts touched
None. Pure plumbing change.
Hints / gotchas
os.environ.get("ONTAP_TIMEOUT"); cast to int if set. _DEFAULT_TIMEOUT
is defined at the top of ontap_client.py. Update the docstring on
from_env() to mention the new optional variable.
Estimated time
10-15 minutes
Exact files to change
python/ontap_client.py(thefrom_env()classmethod)python/README.md(the env-var section)Expected outcome
OntapClient.from_env()reads an optionalONTAP_TIMEOUTenv var(defaults to the existing
_DEFAULT_TIMEOUTof 30 seconds) and passes itas the constructor
timeout=argument. README documents the new env varalongside
ONTAP_HOST,ONTAP_USER,ONTAP_PASS,ONTAP_VERIFY_SSL.How to test
Against an unreachable host, this fails within ~2 seconds. With
ONTAP_TIMEOUTunset, behavior is unchanged (30s default).ONTAP concepts touched
None. Pure plumbing change.
Hints / gotchas
os.environ.get("ONTAP_TIMEOUT"); cast tointif set._DEFAULT_TIMEOUTis defined at the top of
ontap_client.py. Update the docstring onfrom_env()to mention the new optional variable.