Skip to content

Commit 226d3c5

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix build errors missing podman/docker module"
2 parents 29fbfbe + 1d204e7 commit 226d3c5

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

kolla/image/tasks.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -417,15 +417,18 @@ def reset_userinfo(tarinfo):
417417

418418
except engine.getEngineException(self.conf) as e:
419419
image.status = Status.ERROR
420-
if isinstance(e, docker.errors.BuildError):
421-
for line in e.build_log:
422-
if 'stream' in line:
423-
self.logger.error(line['stream'].strip())
424-
if isinstance(e, podman.errors.exceptions.BuildError):
425-
for line in e.build_log:
426-
line = json.loads(line)
427-
if 'stream' in line:
428-
self.logger.error(line['stream'].strip())
420+
if self.conf.engine == engine.Engine.DOCKER.value:
421+
if isinstance(e, docker.errors.BuildError):
422+
for line in e.build_log:
423+
if 'stream' in line:
424+
self.logger.error(line['stream'].strip())
425+
elif self.conf.engine == engine.Engine.PODMAN.value:
426+
if isinstance(e, podman.errors.exceptions.BuildError):
427+
for line in e.build_log:
428+
line = json.loads(line)
429+
if 'stream' in line:
430+
self.logger.error(line['stream'].strip())
431+
429432
self.logger.exception('Unknown container engine '
430433
'error when building')
431434

0 commit comments

Comments
 (0)