gnetclisdk 1.0.99__tar.gz → 1.0.101__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gnetclisdk
3
- Version: 1.0.99
3
+ Version: 1.0.101
4
4
  Summary: Client for Gnetcli GRPC-server
5
5
  Home-page: https://github.com/annetutil/gnetcli
6
6
  Author: Alexander Balezin
@@ -14,7 +14,7 @@ from google.protobuf.message import Message
14
14
 
15
15
  from .proto import server_pb2, server_pb2_grpc
16
16
  from .auth import BasicClientAuthentication, ClientAuthentication, OAuthClientAuthentication
17
- from .exceptions import parse_grpc_error
17
+ from .exceptions import parse_grpc_error, DeviceConnectError
18
18
  from .interceptors import get_auth_client_interceptors
19
19
 
20
20
  _logger = logging.getLogger(__name__)
@@ -470,6 +470,8 @@ async def grpc_call_wrapper(stub: grpc.UnaryUnaryMultiCallable, request: Any) ->
470
470
  verbose=verbose,
471
471
  )
472
472
  last_exc.__cause__ = e
473
+ if gn_exc == DeviceConnectError:
474
+ continue
473
475
  raise last_exc from None
474
476
  else:
475
477
  last_exc = None
@@ -33,7 +33,7 @@ class GnetcliException(Exception):
33
33
  super().__init__(self.message)
34
34
 
35
35
 
36
- class DeviceConnectError(GnetcliException):
36
+ class DeviceConnectionError(GnetcliException):
37
37
  """
38
38
  Problem with connection to a device.
39
39
  """
@@ -41,6 +41,14 @@ class DeviceConnectError(GnetcliException):
41
41
  pass
42
42
 
43
43
 
44
+ class DeviceConnectError(GnetcliException):
45
+ """
46
+ Problem with connecting to a device.
47
+ """
48
+
49
+ pass
50
+
51
+
44
52
  class UnknownDevice(GnetcliException):
45
53
  """
46
54
  Host is not found in inventory
@@ -49,7 +57,7 @@ class UnknownDevice(GnetcliException):
49
57
  pass
50
58
 
51
59
 
52
- class DeviceAuthError(DeviceConnectError):
60
+ class DeviceAuthError(DeviceConnectionError):
53
61
  """
54
62
  Unable to authenticate on a device.
55
63
  """
@@ -140,9 +148,12 @@ def parse_grpc_error(grpc_error: grpc.aio.AioRpcError) -> Tuple[Type[GnetcliExce
140
148
  return DeviceAuthError, verbose
141
149
  elif detail in {"connection_error", "busy_error"}:
142
150
  verbose = ""
143
- return DeviceConnectError, verbose
151
+ return DeviceConnectionError, verbose
144
152
  elif detail in {"exec_error", "generic_error"}:
145
153
  verbose = ""
146
154
  return ExecError, verbose
155
+ elif detail == "connect_error":
156
+ verbose = str(error_info)
157
+ return DeviceConnectError, verbose
147
158
 
148
159
  return GnetcliException, ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gnetclisdk
3
- Version: 1.0.99
3
+ Version: 1.0.101
4
4
  Summary: Client for Gnetcli GRPC-server
5
5
  Home-page: https://github.com/annetutil/gnetcli
6
6
  Author: Alexander Balezin
File without changes
File without changes
File without changes
File without changes
File without changes