def push_image(self, image, insecure=False):
        """
        push provided image to registry

        :param image: ImageName
        :param insecure: bool, allow connecting to registry over plain http
        :return: str, logs from push
        """
        logger.info("pushing image '%s'", image)
        logger.debug("image: '%s', insecure: '%s'", image, insecure)
        try:
            # push returns string composed of newline separated jsons; exactly what 'docker push' outputs
            logs = self.d.push(image.to_str(tag=False), tag=image.tag, insecure_registry=insecure, stream=True)
        except TypeError:
            # because changing api is fun
            logs = self.d.push(image.to_str(tag=False), tag=image.tag, stream=True)

        command_result = wait_for_command(logs)
        self.last_logs = command_result.logs
        if command_result.is_failed():
            raise RuntimeError("Failed to push image %s" % image)
        return command_result.parsed_logs
dataset/ETHPy150Open projectatomic/atomic-reactor/atomic_reactor/core.py/DockerTasker.push_image/original