atk-common 3.5.0__py3-none-any.whl → 3.6.0__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.
@@ -34,7 +34,7 @@ class ErrorHandler(IErrorHandler):
34
34
  err_str += ', containerName: <none>'
35
35
  self.logger.error(err_str)
36
36
 
37
- def get_error_entity(self, error, method, error_type, status_code, container_info):
37
+ def get_error_entity(self, error, method, error_type, status_code):
38
38
  data = {}
39
39
  data['statusCode'] = status_code
40
40
  data['exceptionType'] = str(type(error))
@@ -42,7 +42,7 @@ class ErrorHandler(IErrorHandler):
42
42
  data['message'] = self.get_message(error)
43
43
  data['method'] = method
44
44
  data['timestamp'] = get_utc_date_time_str()
45
- data['containerInfo'] = container_info
45
+ data['containerInfo'] = self.docker_handler.get_current_container_info()
46
46
  self.create_error_log(data)
47
47
  return Response(
48
48
  response=json.dumps(data),
@@ -27,7 +27,7 @@ class HttpResponseHandler(IHttpResponseHandler):
27
27
  # If response['status'] == 1 (HTTP): resend received error entity
28
28
  # If response['status'] == 2 (INTERNAL): create new error entity and return as response
29
29
  # If http status other value: create new error entity and return as response
30
- def http_response(self, method, response, container_info):
30
+ def http_response(self, method, response):
31
31
  if is_http_status_ok(response['statusCode']):
32
32
  return Response(
33
33
  response=self._convert_response_data(response['responseMsg']),
@@ -38,5 +38,5 @@ class HttpResponseHandler(IHttpResponseHandler):
38
38
  elif is_http_status_internal(response['statusCode']):
39
39
  if is_response_http(response):
40
40
  return self.error_handler.resend_error_entity(response['responseMsg'])
41
- return self.error_handler.get_error_entity(response['responseMsg'], method, ApiErrorType.INTERNAL, response['statusCode'], container_info)
42
- return self.error_handler.get_error_entity(response['responseMsg'], method, ApiErrorType.CONNECTION, response['statusCode'], container_info)
41
+ return self.error_handler.get_error_entity(response['responseMsg'], method, ApiErrorType.INTERNAL, response['statusCode'])
42
+ return self.error_handler.get_error_entity(response['responseMsg'], method, ApiErrorType.CONNECTION, response['statusCode'])
@@ -4,7 +4,7 @@ from typing import Protocol
4
4
  class IErrorHandler(Protocol):
5
5
  def get_message(self, error) -> None: ...
6
6
  def create_error_log(self, data) -> None: ...
7
- def get_error_entity(self, error, method, error_type, status_code, container_info) -> None: ...
7
+ def get_error_entity(self, error, method, error_type, status_code) -> None: ...
8
8
  def resend_error_entity(self, error_entity) -> None: ...
9
9
  def handle_error(self, resp, status) -> None: ...
10
10
  def get_response_error(self, resp) -> None: ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atk_common
3
- Version: 3.5.0
3
+ Version: 3.6.0
4
4
  Summary: ATK common methods
5
5
  Home-page: https://github.com/pypa/atk_common
6
6
  Author: Roger
@@ -20,8 +20,8 @@ atk_common/classes/__init__.py,sha256=O_VHYxAilmoz3i9L6jkwS-JZ4UaTezdhFiA5liNl1l
20
20
  atk_common/classes/bo_logger.py,sha256=pEdk4bl0Vr60yWVihT7Fm395lMmO8JBBNeEhtDyIO5c,2250
21
21
  atk_common/classes/docker_handler.py,sha256=73WiebIT_RwGgwyvIed_Q5p8Tsb1b22JChBDyUmf1IU,2949
22
22
  atk_common/classes/env_handler.py,sha256=h3snKwHwDvfc2dt1vgHasqv8n_vnsI9J2MAr-XM5oow,1283
23
- atk_common/classes/error_handler.py,sha256=uev5LFh2YIQRZo--es2F84bAz-ndh2G02H2DgvBx3wc,3254
24
- atk_common/classes/http_response_handler.py,sha256=B83UW-W6pE5BcUaoYcIb1RS-TzZEeZ22vgWmvB7xT30,2176
23
+ atk_common/classes/error_handler.py,sha256=TiviyBOTVcUBPjXd_DAgeUEQSvEdDCjFrAmEzTLuDVE,3272
24
+ atk_common/classes/http_response_handler.py,sha256=l8CfntLPRHbB1nfUPPGnmTvQMAM29CVK4THG4FK1_4k,2128
25
25
  atk_common/classes/rabbitmq_consumer.py,sha256=jct1UnfP-PU3IeWW2S_9dQ7FxmY0_M8YwZadFMv52j8,2936
26
26
  atk_common/enums/__init__.py,sha256=hOSoKWIBUpRFaMN2tNJiel6iGI1MHj229OYnU1J8Jg0,2636
27
27
  atk_common/enums/api_error_type_enum.py,sha256=9oW6ZaZ3lhMwR8r2sVNWGliS9C_jV-otiOYdezAuTp0,91
@@ -66,7 +66,7 @@ atk_common/enums/violation_type_enum.py,sha256=01qTHOj-O8bOc-nwIHVnxLosm4cusD_Yu
66
66
  atk_common/interfaces/__init__.py,sha256=HynEg28Uy3msO7qd__VxajTasSe9-Evpj9yi3Uw2NTo,508
67
67
  atk_common/interfaces/docker_handler_interface.py,sha256=aCJ6cELRlrbZC-sB-RQEpKhChCMEiYNclcfr62YjSCo,411
68
68
  atk_common/interfaces/env_handler_interface.py,sha256=yrmtTplH5tnuOAs7CW5RtzLMTE5q9sdzTYjiS2naNQQ,300
69
- atk_common/interfaces/error_handler_interface.py,sha256=H43hSeeThT_7EbNzh-rygAJWNAmyzFetodiXdmqKshU,522
69
+ atk_common/interfaces/error_handler_interface.py,sha256=ErhQ69T3fCYUl6sS5GwiMgW-znapmGcmgWLR2QLNu8c,506
70
70
  atk_common/interfaces/http_response_handler_interface.py,sha256=QjDmhVj4AnUyoRtSHk_sfFPI-cto6TV7Mx2_87tiOrs,185
71
71
  atk_common/interfaces/logger_interface.py,sha256=36impIkvGZbL5CUMKyaLkYi3jVyin_KRRUqvtyMh05E,381
72
72
  atk_common/utils/__init__.py,sha256=IaP851DJXND3OPkjy-OJxpaNG1zkGlg5bHsUg7mqr-I,1768
@@ -80,7 +80,7 @@ atk_common/utils/hash_utils.py,sha256=S_9o89CdI4lUQbVaqc85TDcqyDNuo30_E3VBaOrZKk
80
80
  atk_common/utils/http_utils.py,sha256=eSRuQeDgN0ISQdByZqE6cIGXoorcAXz7PEtVntHUKAo,670
81
81
  atk_common/utils/internal_response_utils.py,sha256=2X9eLFEy1pO3Aesj1IRXg2yprwNcBDM5_dXaA5vfmMI,694
82
82
  atk_common/utils/mq_utils.py,sha256=DmVcXIZHG45p7cQVvgen6OT8QbW_UifFFJGJBybTkJQ,1835
83
- atk_common-3.5.0.dist-info/licenses/license.txt,sha256=_0O6fWM00-wTurDjnZhUP_N5QiwGhItaQZqHq5eqadA,1063
83
+ atk_common-3.6.0.dist-info/licenses/license.txt,sha256=_0O6fWM00-wTurDjnZhUP_N5QiwGhItaQZqHq5eqadA,1063
84
84
  atk_package/__init__.py,sha256=okIFEefQhQrw6DZg6oCEVWsEdkVCk-57VXBW0IUG_wU,834
85
85
  atk_package/datetime_utils.py,sha256=qsVF7l90P1-xukG2tV_jLqG9J_Yfl5wTpyfrdPBlyMo,239
86
86
  atk_package/env_utils.py,sha256=bXOrxM3fZUslqfmZt75iphbEJHbG4riJa8XOVzPwIII,313
@@ -93,7 +93,7 @@ atk_package/enums/__init__.py,sha256=EtUr_--MQj1Rc_R0sF_ELXIThmhpfmhDWq3YaK9oQMk
93
93
  atk_package/enums/command_status_enum.py,sha256=M2Nln27a_DbzI07-gfytWQk2X087JhkU6Fmard5qVHs,127
94
94
  atk_package/enums/speed_control_status_enum.py,sha256=qpURh0K1L1tSpbrzVnckoe4hUn1illIkbo7k4mLfzIM,182
95
95
  shared_python_atk_enforcement/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
- atk_common-3.5.0.dist-info/METADATA,sha256=7wB0gmqZQrjR4A6KTFsmVqLkPnnPu_TAlbpt7EBYGEg,1760
97
- atk_common-3.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
98
- atk_common-3.5.0.dist-info/top_level.txt,sha256=4CwRjkLnheIdI4jQwc4tK3dbRc58WqUmoqjkdDTWlME,41
99
- atk_common-3.5.0.dist-info/RECORD,,
96
+ atk_common-3.6.0.dist-info/METADATA,sha256=bmh0DRmR1XtoFrz7xMhG4wbtMjN7I5W8LX0fm1KVW7o,1760
97
+ atk_common-3.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
98
+ atk_common-3.6.0.dist-info/top_level.txt,sha256=4CwRjkLnheIdI4jQwc4tK3dbRc58WqUmoqjkdDTWlME,41
99
+ atk_common-3.6.0.dist-info/RECORD,,