atk-common 1.58.0__tar.gz → 1.60.0__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.
- {atk_common-1.58.0 → atk_common-1.60.0}/PKG-INFO +1 -1
- {atk_common-1.58.0 → atk_common-1.60.0}/setup.py +1 -1
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/__init__.py +3 -2
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/docker_utils.py +3 -2
- atk_common-1.60.0/src/atk_common/env_utils.py +18 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common.egg-info/PKG-INFO +1 -1
- atk_common-1.58.0/src/atk_common/env_utils.py +0 -13
- {atk_common-1.58.0 → atk_common-1.60.0}/README.md +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/license.txt +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/pyproject.toml +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/setup.cfg +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/datetime_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/db_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/__init__.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/api_error_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/camera_cabinet_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/camera_role_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/certificate_issuer_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/command_status_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/command_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/config_reply_status_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/detection_status_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/encryption_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/file_exists_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/history_status_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/image_encoding_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/image_part_category_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/image_part_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/image_shelf_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/metering_direction_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/multimotor_status_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/piezo_vehicle_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/process_status_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/response_status_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/section_role_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/sensor_order_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/sensor_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/speed_control_status_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/speed_control_stop_reason.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/test_image_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/violation_type_enum.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/error_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/file_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/hash_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/http_response_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/http_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/internal_response_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/log_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/mq_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/rabbitmq_consumer.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common.egg-info/SOURCES.txt +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common.egg-info/dependency_links.txt +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common.egg-info/requires.txt +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common.egg-info/top_level.txt +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/src/shared_python_atk_enforcement/__init__.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/tests/test_docker_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/tests/test_error_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/tests/test_http_utils.py +0 -0
- {atk_common-1.58.0 → atk_common-1.60.0}/tests/test_log_utils.py +0 -0
@@ -36,7 +36,7 @@ setup(
|
|
36
36
|
# For a discussion on single-sourcing the version across setup.py and the
|
37
37
|
# project code, see
|
38
38
|
# https://packaging.python.org/guides/single-sourcing-package-version/
|
39
|
-
version="1.
|
39
|
+
version="1.60.0", # Required
|
40
40
|
# This is a one-line description or tagline of what your project does. This
|
41
41
|
# corresponds to the "Summary" metadata field:
|
42
42
|
# https://packaging.python.org/specifications/core-metadata/#summary
|
@@ -9,7 +9,7 @@ from atk_common.datetime_utils import \
|
|
9
9
|
convert_to_utc, \
|
10
10
|
convert_to_utc_image_dt
|
11
11
|
from atk_common.db_utils import sql, sql_with_record, convert_none_to_null, date_time_utc_column
|
12
|
-
from atk_common.docker_utils import get_current_container_info
|
12
|
+
from atk_common.docker_utils import get_current_container_info, set_container_metadata
|
13
13
|
from atk_common.env_utils import get_env_value
|
14
14
|
from atk_common.error_utils import get_message, create_error_log, get_error_entity, resend_error_entity, handle_error, get_response_error, get_error_type
|
15
15
|
from atk_common.http_response_utils import http_response
|
@@ -34,6 +34,8 @@ __all__ = [
|
|
34
34
|
'sql_with_record',
|
35
35
|
'convert_none_to_null',
|
36
36
|
'date_time_utc_column',
|
37
|
+
'get_current_container_info',
|
38
|
+
'set_container_metadata',
|
37
39
|
'get_env_value',
|
38
40
|
'get_message',
|
39
41
|
'create_error_log',
|
@@ -56,5 +58,4 @@ __all__ = [
|
|
56
58
|
'add_log_item_http',
|
57
59
|
'decode_message',
|
58
60
|
'RabbitMQConsumer',
|
59
|
-
'get_current_container_info',
|
60
61
|
]
|
@@ -60,10 +60,11 @@ def get_current_container_info():
|
|
60
60
|
add_log_item("Error getting container data:" + str(e))
|
61
61
|
return None
|
62
62
|
|
63
|
-
def set_container_metadata(
|
63
|
+
def set_container_metadata(image_name_env_key, image_version_env_key):
|
64
64
|
data = {}
|
65
|
+
image_name = get_env_value(image_name_env_key)
|
65
66
|
data['imageName'] = image_name
|
66
|
-
data['imageVersion'] = get_env_value(image_version_env_key
|
67
|
+
data['imageVersion'] = get_env_value(image_version_env_key)
|
67
68
|
data['containerName'] = image_name
|
68
69
|
create_container_log(data)
|
69
70
|
return data
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import os
|
2
|
+
from atk_common.log_utils import add_log_item
|
3
|
+
|
4
|
+
def val_str(value):
|
5
|
+
if value is None:
|
6
|
+
return 'Empty'
|
7
|
+
if isinstance(value, str):
|
8
|
+
return value
|
9
|
+
return str(value)
|
10
|
+
|
11
|
+
def get_env_value(key, abort_on_error=True):
|
12
|
+
val = os.environ.get(key)
|
13
|
+
if val is None and abort_on_error:
|
14
|
+
err_msg = f"Environment variable '{key}' is not set."
|
15
|
+
add_log_item(err_msg)
|
16
|
+
raise ValueError(err_msg)
|
17
|
+
add_log_item(key + ':' + val_str(val))
|
18
|
+
return val
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
from atk_common.log_utils import add_log_item
|
3
|
-
|
4
|
-
def get_env_value(key, default_value):
|
5
|
-
try:
|
6
|
-
if default_value is None:
|
7
|
-
return None
|
8
|
-
val = os.environ[key]
|
9
|
-
add_log_item(key + ':' + val)
|
10
|
-
return val
|
11
|
-
except (Exception) as error:
|
12
|
-
add_log_item(key + ':' + default_value)
|
13
|
-
return default_value
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/config_reply_status_type_enum.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{atk_common-1.58.0 → atk_common-1.60.0}/src/atk_common/enums/speed_control_status_type_enum.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|