def _docker_build(self, tag, logger, timeout, limits, path=None,
                      dockerfile=None, fileobj=None, forcerm=True, quiet=True,
                      nocache=False, pull=True):
        success = 1
        try:
            for l in self.docker.build(path=path, dockerfile=dockerfile,
                                       fileobj=fileobj, tag=tag,
                                       timeout=timeout, forcerm=forcerm,
                                       quiet=quiet, nocache=nocache, pull=pull,
                                       container_limits=limits):
                try:
                    info = json.loads(l).get('stream', '')
                    if info:
                        if 'successfully built' in info.lower():
                            success = 0
                    else:
                        err = json.loads(l).get('errorDetail', '')
                        if err:
                            logger.log(logging.ERROR, err)
                except __HOLE__:
                    pass
        except req_exp.ReadTimeoutError:
            logger.log(logging.ERROR, 'docker build timed out, max value: %s' %
                       timeout)
        except (errors.DockerException, errors.APIError) as e:
            LOG.error('Error in building docker image %s, assembly: %s, %s' %
                      (tag, self.assembly.uuid, str(e)))
        return success
dataset/ETHPy150Open openstack/solum/solum/worker/app_handlers/base.py/BaseHandler._docker_build