Skip to content

Update timeout#41

Open
jayssSmm wants to merge 2 commits into
NetApp:mainfrom
jayssSmm:update_timeout
Open

Update timeout#41
jayssSmm wants to merge 2 commits into
NetApp:mainfrom
jayssSmm:update_timeout

Conversation

@jayssSmm
Copy link
Copy Markdown

Summary

Add support for an optional ONTAP_TIMEOUT environment variable in OntapClient.from_env().

Previously, from_env() only read ONTAP_HOST, ONTAP_USER, ONTAP_PASS, and ONTAP_VERIFY_SSL. This change allows users to configure request timeout through environment variables while preserving the existing default timeout behavior of 30 seconds.

Also updates the README documentation to include the new environment variable.

Changes

  • Added support for ONTAP_TIMEOUT in OntapClient.from_env()
  • Cast timeout environment variable to int
  • Preserved existing _DEFAULT_TIMEOUT fallback behavior
  • Updated from_env() docstring
  • Updated python/README.md env-var documentation

Checklist

General

  • No secrets, credentials, or API tokens in code or config

If touching python/

  • Scripts compile (python -m py_compile python/*.py)
  • Lint passes (ruff check python/)

If touching ansible/

  • Syntax check passes (ansible-playbook --syntax-check)
  • ansible-lint passes

If touching terraform/

  • terraform fmt -check passes
  • terraform validate passes

Test Report

Environment: Unreachable test host
Platform version: N/A
Style touched: python

First run

Command + output
$ ONTAP_HOST=10.0.0.1 ONTAP_PASS=x ONTAP_TIMEOUT=2 python cluster_info.py

Request failed within ~2 seconds as expected.

Idempotency / re-run

Second-run evidence
$ ONTAP_HOST=10.0.0.1 ONTAP_PASS=x python cluster_info.py

Behavior unchanged with default 30-second timeout.

Cleanup / teardown

Teardown evidence
No cleanup required.

Related issues

Fixes #35

@jayssSmm jayssSmm requested a review from hvinn as a code owner May 15, 2026 15:37
@github-actions
Copy link
Copy Markdown

Test Report looks present - thanks. Reviewers will verify the captured output and idempotency evidence.

@github-actions github-actions Bot added python Pull requests that update python code docs labels May 15, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first PR to Pace — welcome aboard.

Quick orientation:

  1. CI runs in ~2 minutes. If anything fails, check the Actions tab — most failures have a one-line fix in docs/troubleshooting.md.
  2. If your PR touches python/, ansible/, or terraform/, you'll be asked for a Test Report. It's worth the effort — reviewers rely on it.
  3. Make sure the NetApp CCLA is on file before review.
  4. Stuck? Comment on this PR and a maintainer will jump in. We aim to respond as soon as possible.

For background, see CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant