Skip to content

Commit 9abe527

Browse files
committed
change env vars used for the infrahubctl command to align with SDK
INFRAHUBCTL_TIMEOUT > INFRAHUB_TIMEOUT INFRAHUBCTL_CONCURRENT_EXECUTION > INFRAHUBCTL_MAX_CONCURRENT_EXECUTION
1 parent 5f73796 commit 9abe527

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Aligned the environment variables used by the `infrahubctl` with the environment variables used by the SDK

infrahub_sdk/ctl/cli_commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ async def run(
130130
debug: bool = False,
131131
_: str = CONFIG_PARAM,
132132
branch: str = typer.Option("main", help="Branch on which to run the script."),
133-
concurrent: int = typer.Option(
134-
4,
133+
concurrent: int | None = typer.Option(
134+
None,
135135
help="Maximum number of requests to execute at the same time.",
136-
envvar="INFRAHUBCTL_CONCURRENT_EXECUTION",
136+
envvar="INFRAHUB_MAX_CONCURRENT_EXECUTION",
137137
),
138-
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUBCTL_TIMEOUT"),
138+
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUB_TIMEOUT"),
139139
variables: list[str] | None = typer.Argument(
140140
None, help="Variables to pass along with the query. Format key=value key=value."
141141
),

infrahub_sdk/ctl/exporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def dump(
2626
concurrent: int = typer.Option(
2727
4,
2828
help="Maximum number of requests to execute at the same time.",
29-
envvar="INFRAHUBCTL_CONCURRENT_EXECUTION",
29+
envvar="INFRAHUB_MAX_CONCURRENT_EXECUTION",
3030
),
31-
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUBCTL_TIMEOUT"),
31+
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUB_TIMEOUT"),
3232
exclude: list[str] = typer.Option(
3333
["CoreAccount"],
3434
help="Prevent node kind(s) from being exported, CoreAccount is excluded by default",

infrahub_sdk/ctl/importer.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from asyncio import run as aiorun
24
from pathlib import Path
35

@@ -24,12 +26,12 @@ def load(
2426
quiet: bool = typer.Option(False, help="No console output"),
2527
_: str = CONFIG_PARAM,
2628
branch: str = typer.Option("main", help="Branch from which to export"),
27-
concurrent: int = typer.Option(
28-
4,
29+
concurrent: int | None = typer.Option(
30+
None,
2931
help="Maximum number of requests to execute at the same time.",
30-
envvar="INFRAHUBCTL_CONCURRENT_EXECUTION",
32+
envvar="INFRAHUB_MAX_CONCURRENT_EXECUTION",
3133
),
32-
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUBCTL_TIMEOUT"),
34+
timeout: int = typer.Option(60, help="Timeout in sec", envvar="INFRAHUB_TIMEOUT"),
3335
) -> None:
3436
"""Import nodes and their relationships into the database."""
3537
console = Console()

0 commit comments

Comments
 (0)