appmesh 1.5.0__py3-none-any.whl → 1.5.1__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.
appmesh/http_client.py CHANGED
@@ -449,7 +449,7 @@ class AppMeshClient(metaclass=abc.ABCMeta):
449
449
  path="/appmesh/login",
450
450
  header={
451
451
  "Authorization": "Basic " + base64.b64encode((user_name + ":" + user_pwd).encode()).decode(),
452
- "X-Expire-Seconds": self._parse_duration(timeout_seconds),
452
+ "X-Expire-Seconds": str(self._parse_duration(timeout_seconds)),
453
453
  **({"X-Audience": audience} if audience else {}),
454
454
  # **({"X-Totp-Code": totp_code} if totp_code else {}),
455
455
  },
@@ -583,9 +583,7 @@ class AppMeshClient(metaclass=abc.ABCMeta):
583
583
  resp = self._request_http(
584
584
  AppMeshClient.Method.POST,
585
585
  path="/appmesh/token/renew",
586
- header={
587
- "X-Expire-Seconds": self._parse_duration(timeout),
588
- },
586
+ header={"X-Expire-Seconds": str(self._parse_duration(timeout))},
589
587
  )
590
588
  if resp.status_code == HTTPStatus.OK:
591
589
  if "access_token" in resp.json():
@@ -1198,11 +1196,11 @@ class AppMeshClient(metaclass=abc.ABCMeta):
1198
1196
  ########################################
1199
1197
  # Application run
1200
1198
  ########################################
1201
- def _parse_duration(self, timeout) -> str:
1199
+ def _parse_duration(self, timeout) -> int:
1202
1200
  if isinstance(timeout, int):
1203
- return str(timeout)
1201
+ return timeout
1204
1202
  elif isinstance(timeout, str):
1205
- return str(int(aniso8601.parse_duration(timeout).total_seconds()))
1203
+ return int(aniso8601.parse_duration(timeout).total_seconds())
1206
1204
  else:
1207
1205
  raise TypeError(f"Invalid timeout type: {str(timeout)}")
1208
1206
 
@@ -1238,8 +1236,8 @@ class AppMeshClient(metaclass=abc.ABCMeta):
1238
1236
  body=app.json(),
1239
1237
  path=path,
1240
1238
  query={
1241
- "timeout": self._parse_duration(max_time_seconds),
1242
- "lifecycle": self._parse_duration(life_cycle_seconds),
1239
+ "timeout": str(self._parse_duration(max_time_seconds)),
1240
+ "lifecycle": str(self._parse_duration(life_cycle_seconds)),
1243
1241
  },
1244
1242
  )
1245
1243
  if resp.status_code != HTTPStatus.OK:
@@ -1318,8 +1316,8 @@ class AppMeshClient(metaclass=abc.ABCMeta):
1318
1316
  body=app.json(),
1319
1317
  path=path,
1320
1318
  query={
1321
- "timeout": self._parse_duration(max_time_seconds),
1322
- "lifecycle": self._parse_duration(life_cycle_seconds),
1319
+ "timeout": str(self._parse_duration(max_time_seconds)),
1320
+ "lifecycle": str(self._parse_duration(life_cycle_seconds)),
1323
1321
  },
1324
1322
  )
1325
1323
  exit_code = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: appmesh
3
- Version: 1.5.0
3
+ Version: 1.5.1
4
4
  Summary: Client SDK for App Mesh
5
5
  Home-page: https://github.com/laoshanxi/app-mesh
6
6
  Author: laoshanxi
@@ -3,11 +3,11 @@ appmesh/app.py,sha256=9Q-SOOej-MH13BU5Dv2iTa-p-sECCJQp6ZX9DjWWmwE,10526
3
3
  appmesh/app_output.py,sha256=JK_TMKgjvaw4n_ys_vmN5S4MyWVZpmD7NlKz_UyMIM8,1015
4
4
  appmesh/app_run.py,sha256=9ISKGZ3k3kkbQvSsPfRfkOLqD9xhbqNOM7ork9F4w9c,1712
5
5
  appmesh/appmesh_client.py,sha256=0ltkqHZUq094gKneYmC0bEZCP0X9kHTp9fccKdWFWP0,339
6
- appmesh/http_client.py,sha256=2qrJYd9MpPZz5RNWTQIgxAFmHjn0rNsxLnKt1Ajn7hU,55810
6
+ appmesh/http_client.py,sha256=BMnzxZE2N-P3tLGkf0LKrqCJRWCPYciw-gXj5z_YTbE,55783
7
7
  appmesh/tcp_client.py,sha256=Id1aIKVWncTSZiKRVa4sgwo1tFX2wRqOLiTnI9-dNkE,11001
8
8
  appmesh/tcp_messages.py,sha256=w1Kehz_aX4X2CYAUsy9mFVJRhxnLQwwc6L58W4YkQqs,969
9
9
  appmesh/tcp_transport.py,sha256=-XDTQbsKL3yCbguHeW2jNqXpYgnCyHsH4rwcaJ46AS8,8645
10
- appmesh-1.5.0.dist-info/METADATA,sha256=AsGZC2UcCoZNNn-fPmKnP8rmGujy65aqvnPxKH6Ix1Y,11663
11
- appmesh-1.5.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
12
- appmesh-1.5.0.dist-info/top_level.txt,sha256=-y0MNQOGJxUzLdHZ6E_Rfv5_LNCkV-GTmOBME_b6pg8,8
13
- appmesh-1.5.0.dist-info/RECORD,,
10
+ appmesh-1.5.1.dist-info/METADATA,sha256=86gy_IbptvkM4JXYK0zBX-soylSlBA8ggkx6hoIiJZA,11663
11
+ appmesh-1.5.1.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
12
+ appmesh-1.5.1.dist-info/top_level.txt,sha256=-y0MNQOGJxUzLdHZ6E_Rfv5_LNCkV-GTmOBME_b6pg8,8
13
+ appmesh-1.5.1.dist-info/RECORD,,