Skip to content

[good-first-issue] Honour ONTAP_TIMEOUT env var in OntapClient.from_env() #35

@hvinn

Description

@hvinn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions