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(): ...@@ -444,7 +444,7 @@ class Containerize():
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m') logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit(1) return False
else: else:
result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', cmd.getBefore()) result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', cmd.getBefore())
if result is not None: if result is not None:
...@@ -520,12 +520,13 @@ class Containerize(): ...@@ -520,12 +520,13 @@ class Containerize():
logging.info('\u001B[1m Building OAI Image(s) Pass\u001B[0m') logging.info('\u001B[1m Building OAI Image(s) Pass\u001B[0m')
HTML.CreateHtmlTestRow(self.imageKind, 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.imageKind, 'OK', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize) HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize)
return True
else: else:
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m') logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize) HTML.CreateHtmlNextTabHeaderTestRow(collectInfo, allImagesSize)
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit(1) return False
def BuildProxy(self, HTML): def BuildProxy(self, HTML):
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '': if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
...@@ -608,7 +609,7 @@ class Containerize(): ...@@ -608,7 +609,7 @@ class Containerize():
mySSH.close() mySSH.close()
HTML.CreateHtmlTestRow('commit ' + tag, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow('commit ' + tag, 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit(1) return False
else: else:
logging.debug('L2sim proxy image for tag ' + tag + ' already exists, skipping build') 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 ...@@ -830,9 +830,13 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
if not CLUSTER.BuildClusterImage(HTML): if not CLUSTER.BuildClusterImage(HTML):
RAN.prematureExit = True RAN.prematureExit = True
elif action == 'Build_Image': elif action == 'Build_Image':
CONTAINERS.BuildImage(HTML) success = CONTAINERS.BuildImage(HTML)
if not success:
RAN.prematureExit = True
elif action == 'Build_Proxy': elif action == 'Build_Proxy':
CONTAINERS.BuildProxy(HTML) success = CONTAINERS.BuildProxy(HTML)
if not success:
RAN.prematureExit = True
elif action == 'Push_Local_Registry': elif action == 'Push_Local_Registry':
success = CONTAINERS.Push_Image_to_Local_Registry(HTML) success = CONTAINERS.Push_Image_to_Local_Registry(HTML)
if not success: 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