diff --git a/kolla/image/build.py b/kolla/image/build.py index 159fa695df..b198072918 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -569,15 +569,15 @@ class BuildTask(DockerTask): buildargs = self.update_buildargs() try: - for response in self.dc.build(path=image.path, - tag=image.canonical_name, - nocache=not self.conf.cache, - rm=True, - network_mode=self.conf.network_mode, - pull=pull, - forcerm=self.forcerm, - buildargs=buildargs): - stream = json.loads(response.decode('utf-8')) + for stream in self.dc.build(path=image.path, + tag=image.canonical_name, + nocache=not self.conf.cache, + rm=True, + decode=True, + network_mode=self.conf.network_mode, + pull=pull, + forcerm=self.forcerm, + buildargs=buildargs): if 'stream' in stream: for line in stream['stream'].split('\n'): if line: diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py index d5c7e77dc4..b721bb237e 100644 --- a/kolla/tests/test_build.py +++ b/kolla/tests/test_build.py @@ -87,7 +87,7 @@ class TasksTest(base.TestCase): builder.run() mock_client().build.assert_called_once_with( - path=self.image.path, tag=self.image.canonical_name, + path=self.image.path, tag=self.image.canonical_name, decode=True, network_mode=None, nocache=False, rm=True, pull=True, forcerm=True, buildargs=None) @@ -104,7 +104,7 @@ class TasksTest(base.TestCase): builder.run() mock_client().build.assert_called_once_with( - path=self.image.path, tag=self.image.canonical_name, + path=self.image.path, tag=self.image.canonical_name, decode=True, network_mode='host', nocache=False, rm=True, pull=True, forcerm=True, buildargs=None) @@ -124,7 +124,7 @@ class TasksTest(base.TestCase): builder.run() mock_client().build.assert_called_once_with( - path=self.image.path, tag=self.image.canonical_name, + path=self.image.path, tag=self.image.canonical_name, decode=True, network_mode=None, nocache=False, rm=True, pull=True, forcerm=True, buildargs=build_args) @@ -143,7 +143,7 @@ class TasksTest(base.TestCase): builder.run() mock_client().build.assert_called_once_with( - path=self.image.path, tag=self.image.canonical_name, + path=self.image.path, tag=self.image.canonical_name, decode=True, network_mode=None, nocache=False, rm=True, pull=True, forcerm=True, buildargs=build_args) @@ -164,7 +164,7 @@ class TasksTest(base.TestCase): builder.run() mock_client().build.assert_called_once_with( - path=self.image.path, tag=self.image.canonical_name, + path=self.image.path, tag=self.image.canonical_name, decode=True, network_mode=None, nocache=False, rm=True, pull=True, forcerm=True, buildargs=build_args)