Skip to content

Commit

Permalink
Look back any number of lines to find image build complete message
Browse files Browse the repository at this point in the history
Fixes #321
  • Loading branch information
timthelion committed May 8, 2017
1 parent 8d0094d commit 06a8631
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions logic/subuserlib/classes/docker/dockerDaemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ def build(self,relativeBuildContextPath=None,repositoryFileStructure=None,useCac
# Now we move to regex code stolen from the official python Docker bindings. This is REALLY UGLY!
outputLines = output.split("\n")
search = r'Successfully built ([0-9a-f]+)' #This is REALLY ugly!
match = re.search(search, outputLines[-1]) #This is REALLY ugly!
if not match:
match = re.search(search, outputLines[-2]) #This is REALLY ugly!
match = None
for line in reversed(outputLines):
match = re.search(search, line) #This is REALLY ugly!
if match:
break
if not match:
raise exceptions.ImageBuildException("Unexpected server response when building image.")
shortId = match.group(1) #This is REALLY ugly!
Expand Down

0 comments on commit 06a8631

Please sign in to comment.