utils: be Python 2 compatible when squashing is enabled

INFO:kolla.common.utils.base:Parent lastest layer is: sha256:75835a67d1341bdc7f4cc4ed9fa1631a7d7b6998e9327272afea342d90c4ab6d
ERROR:kolla.common.utils.base:Unknown error when building
Traceback (most recent call last):
File "/home/hrw/devel/linaro/17.12/kolla/kolla/image/build.py", line 598, in builder
    self.squash()
  File "/home/hrw/devel/linaro/17.12/kolla/kolla/image/build.py", line 619, in squash
    tmp_dir=self.conf.squash_tmp_dir)
  File "/home/hrw/devel/linaro/17.12/kolla/kolla/common/utils.py", line 72, in squash
    ex.stdout)
AttributeError: 'CalledProcessError' object has no attribute 'stdout'

stdout was added in Python 3 as alias for output

Change-Id: I7a6cef2ef6201d6b34c640bd6d1c7762c8bf5611
This commit is contained in:
Marcin Juszkiewicz 2018-10-26 16:01:15 +02:00
parent f613ff8a54
commit 74b70d944f
1 changed files with 1 additions and 1 deletions

View File

@ -69,5 +69,5 @@ def squash(old_image, new_image,
subprocess.check_output(cmds, stderr=subprocess.STDOUT) # nosec
except subprocess.CalledProcessError as ex:
LOG.exception('Get error during squashing image: %s',
ex.stdout)
ex.output)
raise