diff --git a/src/cli.py b/src/cli.py index 4892a27..60ea313 100644 --- a/src/cli.py +++ b/src/cli.py @@ -254,12 +254,6 @@ def discover_capabilities( default="all", help="Type of data to retrieve (default: all)", ) -@click.option( - "--depth", "-d", - type=int, - default=None, - help="Maximum depth to explore (not implemented yet)", -) def discover_get( target: str, username: str, @@ -268,7 +262,6 @@ def discover_get( output: str, path: str, data_type: str, - depth: int | None, ): """ Get configuration or state data at a YANG path. diff --git a/src/gnmi/__init__.py b/src/gnmi/__init__.py index 7d56061..8836f12 100644 --- a/src/gnmi/__init__.py +++ b/src/gnmi/__init__.py @@ -7,17 +7,17 @@ Arista devices using pygnmi. Usage: from gnmi import GNMIClient - async with GNMIClient( + with GNMIClient( host="leaf1", port=6030, username="admin", password="admin", insecure=True ) as client: - caps = await client.capabilities() + caps = client.capabilities() print(caps) """ -from src.gnmi.client import GNMIClient, GNMIConnectionError, GNMIError, GNMIPathError +from .client import GNMIClient, GNMIConnectionError, GNMIError, GNMIPathError __all__ = ["GNMIClient", "GNMIError", "GNMIConnectionError", "GNMIPathError"] diff --git a/src/gnmi/client.py b/src/gnmi/client.py index 28ef403..9ce3324 100644 --- a/src/gnmi/client.py +++ b/src/gnmi/client.py @@ -159,14 +159,6 @@ class GNMIClient: pass # Ignore cleanup errors self._client = None - async def __aenter__(self) -> GNMIClient: - """Enter async context manager.""" - return self.__enter__() - - async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: - """Exit async context manager.""" - self.__exit__(exc_type, exc_val, exc_tb) - # ========================================================================= # gNMI Operations # ========================================================================= @@ -288,7 +280,7 @@ class GNMIClient: try: value = json.loads(value) except json.JSONDecodeError: - pass # Keep as string if not valid JSON + pass # Keep as string - not valid JSON, will be set as string value try: if operation == "delete":