Merge "Improve kolla image build script for finding parent images"

This commit is contained in:
Jenkins 2017-02-28 17:23:01 +00:00 committed by Gerrit Code Review
commit b094aca837

View File

@ -885,8 +885,15 @@ class KollaWorker(object):
image_name = os.path.basename(path)
canonical_name = (self.namespace + '/' + self.image_prefix +
image_name + ':' + self.tag)
parent_search_pattern = re.compile(r'^FROM.*$', re.MULTILINE)
match = re.search(parent_search_pattern, content)
if match:
parent_name = match.group(0).split(' ')[1]
else:
parent_name = ''
del match
image = Image(image_name, canonical_name, path,
parent_name=content.split(' ')[1].split('\n')[0],
parent_name=parent_name,
logger=make_a_logger(self.conf, image_name))
if self.install_type == 'source':