Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ When in doubt, follow the pattern used by existing files in the same directory.
| Feature | `feature/<short-description>` | `feature/add-snapmirror-example` |
| Bug fix | `fix/<short-description>` | `fix/nfs-provision-timeout` |
| Release | `release/<version>` | `release/0.2.0` |

The default branch is `main`. All PRs target `main`.

### Tags and releases
Expand Down
4 changes: 3 additions & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ pip install -r requirements.txt
All scripts read connection details from environment variables.

> **Important:** The values below are placeholders for illustration only.
> Replace `ONTAP_HOST`, `ONTAP_USER`, and `ONTAP_PASS` with your actual
> Replace `ONTAP_HOST`, `ONTAP_USER`, `ONTAP_TIMEOUT` and `ONTAP_PASS` with your actual
> cluster details before running any script.

```bash
export ONTAP_HOST=10.0.0.1 # cluster management LIF
export ONTAP_USER=admin # default: admin
export ONTAP_PASS=your_password
export ONTAP_TIMEOUT=your_timeout
```

Or use an env file:
Expand All @@ -53,6 +54,7 @@ Or use an env file:
ONTAP_HOST=10.0.0.1
ONTAP_USER=admin
ONTAP_PASS=your_password
ONTAP_TIMEOUT=your_timeout
```

```bash
Expand Down
4 changes: 2 additions & 2 deletions python/ontap_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ def __init__(
password: str,
*,
verify_ssl: bool = False,
timeout: int = _DEFAULT_TIMEOUT,
) -> None:
self.base_url = f"https://{host}/api"
self.timeout = timeout
self._session = requests.Session()
self._session.auth = (username, password)
self._session.verify = verify_ssl
Expand Down Expand Up @@ -112,6 +110,7 @@ def from_env(cls) -> OntapClient:
``ONTAP_USER`` (default ``admin``),
``ONTAP_VERIFY_SSL`` (default ``false``)
"""
timeout = int(os.environ.get("ONTAP_TIMEOUT",_DEFAULT_TIMEOUT))
host = os.environ.get("ONTAP_HOST", "")
if not host:
logger.error("ONTAP_HOST environment variable is required")
Expand All @@ -126,6 +125,7 @@ def from_env(cls) -> OntapClient:
username=os.environ.get("ONTAP_USER", "admin"),
password=password,
verify_ssl=os.environ.get("ONTAP_VERIFY_SSL", "false").lower() == "true",
timeout=timeout
)

# -- HTTP helpers -------------------------------------------------------
Expand Down
Loading