Skip to content

Commit 4472c22

Browse files
committed
Fix default dict and typo
1 parent c7e444c commit 4472c22

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

infrahub_sdk/ctl/cli_commands.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def protocols(
401401
def version() -> None:
402402
"""Display the version of Python and the version of the Python SDK in use."""
403403

404-
console.print(f"Python: v{platform.python_version()}\nPython SDK: v{sdk_version}")
404+
console.print(f"Python: {platform.python_version()}\nPython SDK: v{sdk_version}")
405405

406406

407407
@app.command(name="info")
@@ -482,7 +482,7 @@ def info(detail: bool = typer.Option(False, help="Display detailed information."
482482
"error": None,
483483
"status": ":x:",
484484
"infrahub_version": "N/A",
485-
"user_info": None,
485+
"user_info": {},
486486
"groups": {},
487487
}
488488
try:
@@ -535,7 +535,7 @@ def info(detail: bool = typer.Option(False, help="Display detailed information."
535535
layout["version_info"].update(Panel(version_info, title="Version Information"))
536536

537537
# SDK client configuration panel
538-
pretty_model = Pretty(client.config.dict(), expand_all=True)
538+
pretty_model = Pretty(client.config.model_dump(), expand_all=True)
539539
layout["client_info"].update(Panel(pretty_model, title="Client Info"))
540540

541541
# Infrahub information planel
@@ -560,12 +560,14 @@ def info(detail: bool = typer.Option(False, help="Display detailed information."
560560
# Simple output
561561
table = Table(show_header=False, box=None)
562562
table.add_row("Address:", client.config.address)
563-
table.add_row("Connection Status", info["status"])
563+
table.add_row("Connection Status:", info["status"])
564564
if info["error"]:
565565
table.add_row("Connection Error:", info["error"])
566566

567567
table.add_row("Python Version:", platform.python_version())
568568
table.add_row("SDK Version:", sdk_version)
569569
table.add_row("Infrahub Version:", info["infrahub_version"])
570+
if account := info["user_info"].get("AccountProfile"):
571+
table.add_row("User:", account["display_label"])
570572

571573
console.print(table)

0 commit comments

Comments
 (0)