Commit 1a031797 authored by Robert Schmidt's avatar Robert Schmidt

Use return value of Build_Image/Build_Proxy to decide if abort instead of sysexit

parent 163af6b9
......@@ -444,7 +444,7 @@ class Containerize():
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlTabFooter(False)
sys.exit(1)
return False
else:
result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', cmd.getBefore())
if result is not None:
......@@ -520,12 +520,13 @@ class Containerize():
logging.info('\u001B[1m Building OAI Image(s) Pass\u001B[0m')
HTML.CreateHtmlTestRow(self.imageKind, 'OK', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize)
return True
else:
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize)
HTML.CreateHtmlTabFooter(False)
sys.exit(1)
return False
def BuildProxy(self, HTML):
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
......@@ -608,7 +609,7 @@ class Containerize():
mySSH.close()
HTML.CreateHtmlTestRow('commit ' + tag, 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlTabFooter(False)
sys.exit(1)
return False
else:
logging.debug('L2sim proxy image for tag ' + tag + ' already exists, skipping build')
......
......@@ -830,9 +830,13 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
if not CLUSTER.BuildClusterImage(HTML):
RAN.prematureExit = True
elif action == 'Build_Image':
CONTAINERS.BuildImage(HTML)
success = CONTAINERS.BuildImage(HTML)
if not success:
RAN.prematureExit = True
elif action == 'Build_Proxy':
CONTAINERS.BuildProxy(HTML)
success = CONTAINERS.BuildProxy(HTML)
if not success:
RAN.prematureExit = True
elif action == 'Push_Local_Registry':
success = CONTAINERS.Push_Image_to_Local_Registry(HTML)
if not success:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment