Commit c77e144a authored by Mohammed Ismail's avatar Mohammed Ismail

updated

parent b52f1181
...@@ -126,7 +126,6 @@ class Containerize(): ...@@ -126,7 +126,6 @@ class Containerize():
self.dockerfileprefix = '.rhel8.2' self.dockerfileprefix = '.rhel8.2'
imageNames = [] imageNames = []
if self.host == 'Ubuntu':
result = re.search('eNB', self.imageKind) result = re.search('eNB', self.imageKind)
# Creating a tupple with the imageName and the DockerFile prefix pattern on obelix # Creating a tupple with the imageName and the DockerFile prefix pattern on obelix
if result is not None: if result is not None:
...@@ -139,27 +138,9 @@ class Containerize(): ...@@ -139,27 +138,9 @@ class Containerize():
result = re.search('all', self.imageKind) result = re.search('all', self.imageKind)
if result is not None: if result is not None:
imageNames.append(('oai-enb', 'eNB')) imageNames.append(('oai-enb', 'eNB'))
imageNames.append(('oai-gnb', 'gNB')) #imageNames.append(('oai-gnb', 'gNB'))
imageNames.append(('oai-lte-ue', 'lteUE')) #imageNames.append(('oai-lte-ue', 'lteUE'))
imageNames.append(('oai-nr-ue', 'nrUE')) #imageNames.append(('oai-nr-ue', 'nrUE'))
if len(imageNames) == 0:
imageNames.append(('oai-enb', 'eNB'))
elif self.host == 'Red Hat':
result = re.search('eNB', self.imageKind)
# Creating a tupple with the imageName and the DockerFile prefix pattern on asterix
if result is not None:
imageNames.append(('oai-enb', 'eNB'))
else:
result = re.search('gNB', self.imageKind)
if result is not None:
imageNames.append(('oai-gnb', 'gNB'))
else:
result = re.search('all', self.imageKind)
if result is not None:
imageNames.append(('oai-enb', 'eNB'))
imageNames.append(('oai-gnb', 'gNB'))
imageNames.append(('oai-lte-ue', 'lteUE'))
imageNames.append(('oai-nr-ue', 'nrUE'))
if len(imageNames) == 0: if len(imageNames) == 0:
imageNames.append(('oai-enb', 'eNB')) imageNames.append(('oai-enb', 'eNB'))
...@@ -206,12 +187,7 @@ class Containerize(): ...@@ -206,12 +187,7 @@ class Containerize():
#mySSH.close() #mySSH.close()
#return 0 #return 0
sharedimage = ''
if self.host == 'Ubuntu':
sharedimage = 'ran-build' sharedimage = 'ran-build'
elif self.host == 'Red Hat':
sharedimage = 'ran-build'
# Let's remove any previous run artifacts if still there # Let's remove any previous run artifacts if still there
mySSH.command(self.cli + ' image prune --force', '\$', 5) mySSH.command(self.cli + ' image prune --force', '\$', 5)
mySSH.command(self.cli + ' image rm ' + sharedimage + ':' + imageTag, '\$', 5) mySSH.command(self.cli + ' image rm ' + sharedimage + ':' + imageTag, '\$', 5)
...@@ -242,7 +218,7 @@ class Containerize(): ...@@ -242,7 +218,7 @@ class Containerize():
logging.error('Could not build properly ran-build') logging.error('Could not build properly ran-build')
status = False status = False
else: else:
result = re.search('Size = (?P<size>[0-9\-]+) bytes', mySSH.getBefore()) result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', mySSH.getBefore())
if result is not None: if result is not None:
imageSize = float(result.group('size')) imageSize = float(result.group('size'))
imageSize = imageSize / 1000 imageSize = imageSize / 1000
...@@ -263,7 +239,7 @@ class Containerize(): ...@@ -263,7 +239,7 @@ class Containerize():
logging.error('Could not build properly ' + image) logging.error('Could not build properly ' + image)
status = False status = False
else: else:
result = re.search('Size = (?P<size>[0-9\-]+) bytes', mySSH.getBefore()) result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', mySSH.getBefore())
if result is not None: if result is not None:
imageSize = float(result.group('size')) imageSize = float(result.group('size'))
imageSize = imageSize / 1000 imageSize = imageSize / 1000
......
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