Skip to content

Commit

Permalink
Merge pull request #243 from opsmill/wvd-20250116-remove-infrahubctl-…
Browse files Browse the repository at this point in the history
…env-vars

align environment variables between the SDK and `infrahubctl`
  • Loading branch information
wvandeun authored Jan 20, 2025
2 parents fd6e5f6 + 9abe527 commit 34e3cd5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions changelog/+align-infrahubctl-env-vars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Aligned the environment variables used by the `infrahubctl` with the environment variables used by the SDK
8 changes: 4 additions & 4 deletions infrahub_sdk/ctl/cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ async def run(
debug: bool = False,
_: str = CONFIG_PARAM,
branch: str = typer.Option("main", help="Branch on which to run the script."),
concurrent: int = typer.Option(
4,
concurrent: int | None = typer.Option(
None,
help="Maximum number of requests to execute at the same time.",
envvar="INFRAHUBCTL_CONCURRENT_EXECUTION",
envvar="INFRAHUB_MAX_CONCURRENT_EXECUTION",
),
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUBCTL_TIMEOUT"),
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUB_TIMEOUT"),
variables: list[str] | None = typer.Argument(
None, help="Variables to pass along with the query. Format key=value key=value."
),
Expand Down
4 changes: 2 additions & 2 deletions infrahub_sdk/ctl/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def dump(
concurrent: int = typer.Option(
4,
help="Maximum number of requests to execute at the same time.",
envvar="INFRAHUBCTL_CONCURRENT_EXECUTION",
envvar="INFRAHUB_MAX_CONCURRENT_EXECUTION",
),
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUBCTL_TIMEOUT"),
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUB_TIMEOUT"),
exclude: list[str] = typer.Option(
["CoreAccount"],
help="Prevent node kind(s) from being exported, CoreAccount is excluded by default",
Expand Down
10 changes: 6 additions & 4 deletions infrahub_sdk/ctl/importer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from asyncio import run as aiorun
from pathlib import Path

Expand All @@ -24,12 +26,12 @@ def load(
quiet: bool = typer.Option(False, help="No console output"),
_: str = CONFIG_PARAM,
branch: str = typer.Option("main", help="Branch from which to export"),
concurrent: int = typer.Option(
4,
concurrent: int | None = typer.Option(
None,
help="Maximum number of requests to execute at the same time.",
envvar="INFRAHUBCTL_CONCURRENT_EXECUTION",
envvar="INFRAHUB_MAX_CONCURRENT_EXECUTION",
),
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUBCTL_TIMEOUT"),
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUB_TIMEOUT"),
) -> None:
"""Import nodes and their relationships into the database."""
console = Console()
Expand Down

0 comments on commit 34e3cd5

Please sign in to comment.