gnetclisdk 1.0.99__py3-none-any.whl → 1.0.101__py3-none-any.whl
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.
- gnetclisdk/client.py +3 -1
- gnetclisdk/exceptions.py +14 -3
- {gnetclisdk-1.0.99.dist-info → gnetclisdk-1.0.101.dist-info}/METADATA +1 -1
- gnetclisdk-1.0.101.dist-info/RECORD +11 -0
- gnetclisdk-1.0.99.dist-info/RECORD +0 -11
- {gnetclisdk-1.0.99.dist-info → gnetclisdk-1.0.101.dist-info}/WHEEL +0 -0
- {gnetclisdk-1.0.99.dist-info → gnetclisdk-1.0.101.dist-info}/top_level.txt +0 -0
gnetclisdk/client.py
CHANGED
@@ -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
|
gnetclisdk/exceptions.py
CHANGED
@@ -33,7 +33,7 @@ class GnetcliException(Exception):
|
|
33
33
|
super().__init__(self.message)
|
34
34
|
|
35
35
|
|
36
|
-
class
|
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(
|
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
|
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, ""
|
@@ -0,0 +1,11 @@
|
|
1
|
+
gnetclisdk/auth.py,sha256=GwM7H7Ecb-gwqUTkQorifNB_mtnZfgeS46gOW2Vx1U4,1246
|
2
|
+
gnetclisdk/client.py,sha256=5LEIvHqWk2EVSw4xsaVWPOFahPAiuMObMe2bb9YStu8,19806
|
3
|
+
gnetclisdk/exceptions.py,sha256=Cg94IdDAzQ9Q56Tdif6ladV1IcdBUg0TPa54OBVhJD0,4038
|
4
|
+
gnetclisdk/interceptors.py,sha256=apj3l4lnR2ZcsA49odptrBC0kTDmP6Mp0EzYkeEJz9Y,7010
|
5
|
+
gnetclisdk/proto/server_pb2.py,sha256=v_A3rRjuWKa7rPOrsAPOl_oLmfD4sqT5ELpAyM3cUI0,8126
|
6
|
+
gnetclisdk/proto/server_pb2.pyi,sha256=66Oq_YbkGgEQt9ea-P64H58hiUZoMhqptlMQdl2IAaw,8402
|
7
|
+
gnetclisdk/proto/server_pb2_grpc.py,sha256=H_CmevWcjvGTvp4TmzEV-TJRPq2SsQ6UgoCDc-hosyo,12805
|
8
|
+
gnetclisdk-1.0.101.dist-info/METADATA,sha256=UjVBq7HFXlt_Bx3Vbo9clVAuGGoCfPU5Un02DT68Uao,1794
|
9
|
+
gnetclisdk-1.0.101.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
10
|
+
gnetclisdk-1.0.101.dist-info/top_level.txt,sha256=MNjS8LEt6d2rZ-dUbV2cnqkuTMu3EqEL2eiSvUZuUlA,11
|
11
|
+
gnetclisdk-1.0.101.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
gnetclisdk/auth.py,sha256=GwM7H7Ecb-gwqUTkQorifNB_mtnZfgeS46gOW2Vx1U4,1246
|
2
|
-
gnetclisdk/client.py,sha256=BGLamlnThZkx1NdojblX_iTTRtmhyIcuGpFUe_2bo-4,19716
|
3
|
-
gnetclisdk/exceptions.py,sha256=FVaj3X5163yPFsglfsw3MaZ9r3OE_Cih9N7EL1NTGgo,3791
|
4
|
-
gnetclisdk/interceptors.py,sha256=apj3l4lnR2ZcsA49odptrBC0kTDmP6Mp0EzYkeEJz9Y,7010
|
5
|
-
gnetclisdk/proto/server_pb2.py,sha256=v_A3rRjuWKa7rPOrsAPOl_oLmfD4sqT5ELpAyM3cUI0,8126
|
6
|
-
gnetclisdk/proto/server_pb2.pyi,sha256=66Oq_YbkGgEQt9ea-P64H58hiUZoMhqptlMQdl2IAaw,8402
|
7
|
-
gnetclisdk/proto/server_pb2_grpc.py,sha256=H_CmevWcjvGTvp4TmzEV-TJRPq2SsQ6UgoCDc-hosyo,12805
|
8
|
-
gnetclisdk-1.0.99.dist-info/METADATA,sha256=fZJ_YiDF11RsH7UX96NdUVp6OY3CdmaqtLihwFy-sv8,1793
|
9
|
-
gnetclisdk-1.0.99.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
10
|
-
gnetclisdk-1.0.99.dist-info/top_level.txt,sha256=MNjS8LEt6d2rZ-dUbV2cnqkuTMu3EqEL2eiSvUZuUlA,11
|
11
|
-
gnetclisdk-1.0.99.dist-info/RECORD,,
|
File without changes
|
File without changes
|