atk-common 1.56.0__py3-none-any.whl → 1.58.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.
@@ -1,5 +1,6 @@
1
1
  import docker
2
2
  import socket
3
+ from atk_common.env_utils import get_env_value
3
4
  from atk_common.log_utils import add_log_item
4
5
 
5
6
  def get_image_name_and_version(tags):
@@ -23,7 +24,10 @@ def create_port_item(port, binding):
23
24
  return data
24
25
 
25
26
  def create_container_log(container_data):
26
- log_str = 'Container name: ' + container_data['containerName'] + ', image name: ' + container_data['imageName'] + ', image version: ' + container_data['imageVersion']
27
+ image_name = container_data.get('imageName') or 'Unknown'
28
+ image_version = container_data.get('imageVersion') or 'Unknown'
29
+
30
+ log_str = f'Image name: {image_name}, image version: {image_version}'
27
31
  add_log_item(log_str)
28
32
 
29
33
  def get_current_container_info():
@@ -55,3 +59,11 @@ def get_current_container_info():
55
59
  except Exception as e:
56
60
  add_log_item("Error getting container data:" + str(e))
57
61
  return None
62
+
63
+ def set_container_metadata(image_name, image_version_env_key):
64
+ data = {}
65
+ data['imageName'] = image_name
66
+ data['imageVersion'] = get_env_value(image_version_env_key, 'latest')
67
+ data['containerName'] = image_name
68
+ create_container_log(data)
69
+ return data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atk_common
3
- Version: 1.56.0
3
+ Version: 1.58.0
4
4
  Summary: ATK common methods
5
5
  Home-page: https://github.com/pypa/atk_common
6
6
  Author: Roger
@@ -38,4 +38,25 @@ Dynamic: requires-dist
38
38
  Dynamic: requires-python
39
39
  Dynamic: summary
40
40
 
41
+ # bo-atk-common
42
+
41
43
  This package contains atk enforcement common entities and components
44
+
45
+ # Build procedure
46
+
47
+ Delete the files in the `dist` folder
48
+
49
+ Increment the version number in the `setup.py` file
50
+
51
+ Build the new wheel file:
52
+ ```shell
53
+ python setup.py sdist bdist_wheel
54
+ ```
55
+
56
+ Upload the new wheel file:
57
+ ```shell
58
+ python -m twine upload dist/*
59
+ ```
60
+
61
+
62
+
@@ -1,7 +1,7 @@
1
1
  atk_common/__init__.py,sha256=yQ23thqIxTAn4Ijk7nn5COYqB7hEU3ITYkscIY4lyoU,2158
2
2
  atk_common/datetime_utils.py,sha256=0SC5-Nai4RJH9B0VzvGKUQts_QeRXGb7tJLlsh73LJw,3556
3
3
  atk_common/db_utils.py,sha256=odUtXcS7Mumw5eGyVyVimL_U_lP7TqMX9v8nWO5nMvg,902
4
- atk_common/docker_utils.py,sha256=nkUhp2OhwJsm41JDujHDY-JxQfdDjy91duprH59Esfk,2084
4
+ atk_common/docker_utils.py,sha256=WFQGXOpV3XlgGBkQ8wCr300CPDyyaT5ov43AO3UL0Ok,2454
5
5
  atk_common/env_utils.py,sha256=66v-S0vlkJNaun6ay1XcOGRtYJb4Ce4odJsWxuaHsQc,373
6
6
  atk_common/error_utils.py,sha256=kO-VQlajD8SO9MBxj8MHZRTK_uBXgPa09hy6pfjqZBY,2622
7
7
  atk_common/file_utils.py,sha256=UDwcRquO9IrqRrlUM0t-_g4R1-FKt8ZqQinSEqXOAk8,112
@@ -52,7 +52,7 @@ atk_common/enums/speed_control_status_type_enum.py,sha256=qpURh0K1L1tSpbrzVnckoe
52
52
  atk_common/enums/speed_control_stop_reason.py,sha256=pvLS6fpDhsCiIDAmiQBsHctxZnq-Dl2BOgJOxQnT5Hc,200
53
53
  atk_common/enums/test_image_type_enum.py,sha256=HUjxJorehnzRXMNF2uHk2DrAJ3Y_ajQvp0jW-mtlOhU,140
54
54
  atk_common/enums/violation_type_enum.py,sha256=01qTHOj-O8bOc-nwIHVnxLosm4cusD_YuqXM3ZsiRRk,86
55
- atk_common-1.56.0.dist-info/licenses/license.txt,sha256=_0O6fWM00-wTurDjnZhUP_N5QiwGhItaQZqHq5eqadA,1063
55
+ atk_common-1.58.0.dist-info/licenses/license.txt,sha256=_0O6fWM00-wTurDjnZhUP_N5QiwGhItaQZqHq5eqadA,1063
56
56
  atk_package/__init__.py,sha256=NcsmwFadivgIeWV0-5ACZxqmfo4EzTkJX0r4N6DFAdg,820
57
57
  atk_package/datetime_utils.py,sha256=qsVF7l90P1-xukG2tV_jLqG9J_Yfl5wTpyfrdPBlyMo,239
58
58
  atk_package/env_utils.py,sha256=bXOrxM3fZUslqfmZt75iphbEJHbG4riJa8XOVzPwIII,313
@@ -65,7 +65,7 @@ atk_package/enums/__init__.py,sha256=EtUr_--MQj1Rc_R0sF_ELXIThmhpfmhDWq3YaK9oQMk
65
65
  atk_package/enums/command_status_enum.py,sha256=M2Nln27a_DbzI07-gfytWQk2X087JhkU6Fmard5qVHs,127
66
66
  atk_package/enums/speed_control_status_enum.py,sha256=qpURh0K1L1tSpbrzVnckoe4hUn1illIkbo7k4mLfzIM,182
67
67
  shared_python_atk_enforcement/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
- atk_common-1.56.0.dist-info/METADATA,sha256=zzpAjZ3lciuZ_uZs_QoZGd0V6lUyL-m3mc8UMOIsZeM,1464
69
- atk_common-1.56.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
70
- atk_common-1.56.0.dist-info/top_level.txt,sha256=4CwRjkLnheIdI4jQwc4tK3dbRc58WqUmoqjkdDTWlME,41
71
- atk_common-1.56.0.dist-info/RECORD,,
68
+ atk_common-1.58.0.dist-info/METADATA,sha256=WF-qrgzmIVvyFjf45l6LycXR5sfYYF3tw7KzgCg0dKM,1761
69
+ atk_common-1.58.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ atk_common-1.58.0.dist-info/top_level.txt,sha256=4CwRjkLnheIdI4jQwc4tK3dbRc58WqUmoqjkdDTWlME,41
71
+ atk_common-1.58.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5