CI: Clean_Test_Server_Images(): harmonize code

- pass parameter directly instead of indirectly via class
- harmonize to svr_id to read through common code in the next commits
- pass images to express which images will be deleted
- refactor function to use "with" for cls_cmd, and return success (or
  not)
This commit is contained in:
Robert Schmidt
2024-11-25 15:33:41 +01:00
parent 74317e805d
commit 644990a225
49 changed files with 122 additions and 71 deletions
+3 -4
View File
@@ -379,10 +379,9 @@ def ExecuteActionWithParam(action):
success = CONTAINERS.Pull_Image_from_Registry(HTML, svr_id, images)
elif action == 'Clean_Test_Server_Images':
string_field = test.findtext('test_svr_id')
if (string_field is not None):
CONTAINERS.testSvrId = string_field
success = CONTAINERS.Clean_Test_Server_Images(HTML)
svr_id = test.findtext('svr_id')
images = test.findtext('images').split()
success = CONTAINERS.Clean_Test_Server_Images(HTML, svr_id, images)
elif action == 'Custom_Command':
node = test.findtext('node')